-
Notifications
You must be signed in to change notification settings - Fork 39
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
number_format max_dig with integers #155
Comments
Hi there, that smells blije a bug, or an inconsistency in the documentation. Thanks for reporting! |
Yes, I think this is definitely a bug.
|
I think I've found a possible fix.
Working on my fork I added the two tests above for the function and this rewriting seems to pass everything. I know I have changed quite a bit the logic of the function but honestly I don't feel very comfortable with regex ;) I can (try to) provide a clean pull request too if it's helpful. Thanks for the great work! |
Hello,
Thank you for making this wonderful package.
number_format(x, format = NULL, min_dig = NULL, max_dig = NULL, dec = ".")
I use this expression to check if the input format is +/-[0-9].[0-9]{0,8}.
I find that when max_dig (e.g. max_dig = 8) is specified it expects that all inputs /rows to actually have decimals.
In the manual it says " max_dig maximum number of digits after separator"
So I was expecting that when it encounters integers this max_dig would not be processed.
But in reality if a record is integer it would restrict the number of digits in the integer portion,
Am I using it correctly or perhaps this can be made clearer in the manual?
The text was updated successfully, but these errors were encountered: