num-format
num-format copied to clipboard
Add parsing of formatted strings into integers
that's likely a rabbit hole right here... Trying to guess which locale the number is in to distinguish between 1,000
being a float with int 1
and fraction 000
and an int 1000
with thousands separator, will be tricky.
And then, other numbering systems come in... In JS we decided not to do that for this reason.
I figured I would make the caller pass the locale explicitly, as I agree it's a rabbit hole otherwise.
Example...
let n = "1,000".parse_formatted::<_, u32>(&Locale:en)?
;