Skip to content
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

#293 Format precision #308

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

overthemike
Copy link

This PR might need some heavy critiquing. It works by creating a new instance of currency if a precision option is passed into the format function. This will overwrite the precision value from the instantiation, however. Feel free to outright reject it and maybe suggest a better way to do it and I'd be happy to do that instead. It works though. New tests are written and all the old ones pass.

#293

@shaunhurley
Copy link

Nice work, see what you mean about using an entire new object. I'm interested in this type of functionality as well, our use case is around tipping calculations (multiple tips being split between multiple people, early rounding leads to annoying variances), so I generally work with precision at 4 until display output, which I want to be in standard $x.yy kind of formatting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants