The user can enter a pledge in exponential/scientific notation. This in itself is not a problem, especially as the app supports a currency with DECIMALS_MAX = 8.
However, the user can enter a number with more decimal places than DECIMALS_MAX by using exponential/scientific nation to enter their pledge.
For example, this user can enter a pledge of 2e-15 or 2.1234e-15, which the app (correctly and appropriately) rounds to 0.
The UI will not let the user enter a pledge of 2.12345e-15
Solution
Ensure users cannot enter a pledge with more decimal places than allowed.
This library of mine might be relevant: https://www.npmjs.com/package/intl-number-parser (it solves a slightly different problem, namely parsing numbers in different locales, so long as they are decimal-based)
Problem
The user can enter a pledge in exponential/scientific notation. This in itself is not a problem, especially as the app supports a currency with
DECIMALS_MAX = 8
.However, the user can enter a number with more decimal places than
DECIMALS_MAX
by using exponential/scientific nation to enter their pledge.For example, this user can enter a pledge of 2e-15 or 2.1234e-15, which the app (correctly and appropriately) rounds to 0.
The UI will not let the user enter a pledge of 2.12345e-15
Solution
Ensure users cannot enter a pledge with more decimal places than allowed.