vikasbapat
asked on
Javascript double datatype needed ?
Hi ,
I have a value which converts into NaN while converting using parseFloat() function ,but as of the value range is more its not working.
So is there any other alternate like "parseDouble()" or sort of or any other suggestion or logic to handle this.
eg when I convert parseFloat('123456789.565' ) then it returns NaN. please help me.
Thanks in Advance.
I have a value which converts into NaN while converting using parseFloat() function ,but as of the value range is more its not working.
So is there any other alternate like "parseDouble()" or sort of or any other suggestion or logic to handle this.
eg when I convert parseFloat('123456789.565'
Thanks in Advance.
function add()
{
var ch1 = '1212154.45'; //Comes from textbox
var ch2 = '1212154454.45'; //Comes from textbox
alert(parseFloat(ch1) ) // returns NaN
var total = parseFloat(ch1) + parseFloat(ch2)
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Normally I have read somewhere, that they should convert automatically when used with a mathematical operation.
typo, should read 'reals' not 'rels'"
ASKER
ok thank you i will try that example
A B grade? I think I have answered the question exactly?