subtraction of two variable
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
subtraction of two variable
Hi guys,
I have an issue of subtraction of two variable with large numbers. Here is my script:
function test() { var str1 = "1,000,659,875,073,160"; var str2 = "1"; str1 = Utilities.FormatFloat(0, str1); str2 = Utilities.FormatFloat(0, str2); Log["Message"](str1); Log["Message"](str2); var res = aqConvert["VarToFloat"](str1) - aqConvert["VarToFloat"](str2); Log["Message"](res); }
And attached screenshots of the result.
Can you please help me?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
I bet there is no issue. "E15" is scientific notation for large numbers. E15 means 1*10^15 and means 1 with 15 zéros.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your prompt reply,
Yes, I see it is an scientific notation 🙂 . This is only my issue, not a bug. But I would someone can help me how to format the number from hexadecimal to decimal number.
Could someone help me, please 🙂
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Scientific notation is still decimal, not hexadecimal. In Javascript there is a Number.toFixed() function which gets rid of the scientific notation. Your scripting language (is that C++ script or C# script?) probably has a similar feature.
