-
Notifications
You must be signed in to change notification settings - Fork 1
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
Option for custom number formatting #8
Comments
About that, |
Just wanted to let you know I've started working on it here: https://github.com/Phate6660/bcalc/tree/output-formatting |
I think that's a good start. Although I think being able to set format as For example, on a minimal Void Linux system and it returns:
Setting any value for any other language doesn't work for me. e.g.
|
Oh hmm. builtin printf doesn't support locale stuff, but the actual command (not builtin) does. Yep, I will definitely set up formatting in that case. |
How does it look now? I just pushed a few commits to the branch. |
I've checked it. It has these issues:
If we want to do this with args, we'd have to use 3 args:
This will probably get complex. |
Well, I don't think we have to worry about decimals, since they aren't even supported im bash anyway. And adding support for them would lead to this not being pure bash. That being said, it should be simple to allow the user to change how the numbers are grouped. |
This is already supported in the output-format branch. Supply |
Oh, I didn't know that. Can the decimal places calculation be done manually? Like we do in paper? Until it's possible the current implementation seems fine for a bash calculator. But I'm curious if we would need other more important args to be the second one later in time. Maybe we should specify it with an identifier, like Sorry if I'm pushing things far. You don't have to consider these if these are too complex for the scope of the project.
That would be great thanks. EDIT: Added longer version of arg |
Oh it definitely could, thinking about it now.
That is certainly a possiblity.
On no, don't be! I'm glad to have these things asked for. And as a P.S., I'm really close to getting the custom grouping done. |
That's great to hear. Looking forward to it. Let me know if I can test anything. |
I was thinking about the default comma formatting. Right now it does this:
But there are other countries with other number formatting traditions. For example I found this article showing some of them. It would be great if this formatting can be specified.
I'm not sure what would be the best way to do it. I was hoping if it was possible to specify the format with an arg like
###,###,###.##
. Another way would probably be to mention the country codes.The text was updated successfully, but these errors were encountered: