Forum Discussion

lucky_star's avatar
Occasional Contributor
7 years ago

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);
  var res = aqConvert["VarToFloat"](str1) - aqConvert["VarToFloat"](str2);

And attached screenshots of the result.

Can you please help me?


3 Replies

  • m_essaid's avatar
    Valued Contributor


    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.

    • lucky_star's avatar
      Occasional Contributor

      Thank you for your prompt reply, :heart:


      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 :)

  • SanderK's avatar
    Occasional Contributor

    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.