This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes parseFloat() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "parseFloat()" Watch "parseFloat()" New topic
Author

parseFloat()

Sreejith kayappuram
Ranch Hand

Joined: Jun 24, 2008
Posts: 35
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 ?


Thanks
Sreejith
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8264

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: parseFloat()
 
Similar Threads
JAVAscript and JSP
Strange Javascript Error
Number Conversion to German Format!!
floating image in firefox ? still in trouble ^_^
simple problem,pl. help