I have few issues with "Number" data type
1) trying to convert string "0.0000007" to Number i am getting value with exponential (1e-7). This is only when we have more than 5 0's after decimal.
2) If i try to do below calculation, i am not getting exact value:
ex: 999999.999999+999999999999=1000000999999-999999999999 = 1000000(expected should be:999999.999999)
0.3*6=1.79999998 (exact value: 1.8)
Please let me know what might be the issue......
Thanks in advance to all....
cast it to "int"
int - cannot handle decimal values.
That's standard behavior for floating point. If you search the forum for
past discussions of floating point and Number you'll see explanations why.
To get displayable strings, use toPrecision or toFixed