• Resolved ramanandmehta

    (@ramanandmehta)


    Sir, I found a bug (Maybe).
    I set an equation: fieldname2 * 1152921504606846976
    and I got result= 1152921504606847000 when I entered value 1 in fieldname2.

    why this happend?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @ramanandmehta

    The issue is not caused by the plugin. It is related to the implementation of the Javascript engine of browsers. Please look at the screenshot below. I evaluated the operation directly in the browser’s console.

    You have two possible solutions.

    You can transform the numbers to BigInt and the result into a string:

    String(BigInt(1152921504606846976)*BigInt(1))

    The second alternative would be to use a complementary plugin like “Complementary Libraries for Calculated Fields Form” (https://cff-bundles.dwbooster.com/product/complementary-libraries) to import the Math.js library and use its BigNumbers operations.

    Best regards.

    Thread Starter ramanandmehta

    (@ramanandmehta)

    If I will install suggested plugin, How I will have to set the equation?
    Will it be same or it will be changed?
    Or just I have to enable math.js library?

    Plugin Author codepeople

    (@codepeople)

    Hello @ramanandmehta

    If you install the complementary plugin and import the Math.JS library, you must use the Math.JS operations (https://mathjs.org/docs/index.html).

    math.multiply(math.bignumber(1152921504606846976), math.bignumber(1))

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘bug in big number calculation’ is closed to new replies.