|
-
double to String problem
I designed a reporting engine that calculats totals at the end, so I needed
to convert double to String, in order to append it to a StringBuffer variable.
String text = new String().valueOf(double);
or
StringBuffer strBuf = new StringBuffer();
strBuf.append(double);
cell.addObject(new HTMLText(strBuf.toString()));
But after the convertion the value 6.20, for instance, becomes
6.199999999999998
Do you have any suggestions?
Thanx.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks