javascriptjquery-inputmask

How to display numbers with scientific notation in jquery-inputmask


I am using the jquery-inputmask plugin to handle integer/float numbers, my options for masking are

{ allowMinus: true, rightAlign: false, digits: 3 }

Problem is when the user inputs a large value like:

123456789012345678901234567890

this gets saved with an exponential like:

1.2345678901234568e+29

Now when I want to set this number: 1.2345678901234568e+29 as a value for the input the masking is applied so this number gets transformed to:

+291.2345678901234568

Is there an option for how I can show big numbers like this using the inputmask plugin?


Solution

  • For that reason you can use BigInt:

    https://github.com/tc39/proposal-bigint