You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Clashsoft I'm afraid, there is no reliable, numeric way to determine how many digits are present in the fractional part. Theoretically, we should be able to simply multiply the value by 10 until we get an integer, but as we all know, float operations may end up with an unexpected result and it won't work in some cases.
NoNameProvided
changed the title
IsNumber decorator fails on values ABS(x) < 0.000001
fix: IsNumber decorator fails on values ABS(x) < 0.000001 when using maxDecimalPlaces
Nov 17, 2022
Hi team,
IsNumber
decorator throws error, when a small value is analyzed (ABS(x) < 0.000001. It happens because such a small value has exponential format -->The following code fails, because
value.toString().split('.')[1]
is not available - there's no.
in the string!class-validator/src/decorator/typechecker/IsNumber.ts
Line 34 in 2ef8ff0
The text was updated successfully, but these errors were encountered: