-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$formatNumber always pads numbers with '0' #161
Labels
Comments
Good spot. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The formatNumber function sometimes needs to pad numbers with zeroes. For example, this expression:
returns the number 2 padded to 3 digits before and after the decimal place:
If I provide a custom zero digit, I'd expect formatNumber to use it for the padding. But this expression:
produces this:
As you might expect, the '2' is now a 'C' but it's padded with '0' instead of the zero digit specified (I used the letter 'A' but the outcome is the same whatever character you choose*).
The same applies to exponents that need padding, e.g.
returns:
[*] When I was trying out these examples, I noticed that formatNumber doesn't handle non-BMP zero digit characters such as '𝟶' (U+1D7F6). I suspect this is related to issue 156 but I haven't investigated further.
The text was updated successfully, but these errors were encountered: