File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

parseFloat()

 
Sreejith kayappuram
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i want to parse a long float value.

document.write(parseFloat("9999999999999999"));
result = > 999999999999999


But if value is

document.write(parseFloat("99999999999999999"));

result = > 10000000000000000

is there any other way i can parse this long value ?
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be aware that floating-point numbers on computers are approximations, not exact values. This JDC Article has examples to illustrate the problem and a solution in Java.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic