Closed Robin-Hoodie closed 1 year ago
The library does not manually specify any particular character codes for negative numbers. Please share a reproducible repo/sandbox to illustrate the problem you are referring to.
Oddly enough I can't reproduce this in a sandbox, even when passing the exact same props as I do in my application. It must thus be something in my application that is doing this.
Closing this, apologies
When using the option
segmentValueFormatter
, the value that is passed to the function is a string. If the original value is a negative number, the string that is passed will contain "−" (charcode 8722) instead of "-" (charcode 45).This makes conversion of the number string back to a number result in
NaN
usingNumber
/parseInt
/parseFloat