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

format: fix f precision when exponent > 0 #148

Conversation

kjgorman
Copy link
Contributor

👋Hi @ericlagergren — we've noticed a small edge case in the f format flag. It looks like this will be also fixed in #144 but I figured I would report it anyway and propose a small change for the existing version if that one is still WIP.


Previously we would take only precision without also considering the
exponent, meaning you would have scenarios like 200 being formatted with
%.2f as just 200 as x.exp would be 2, and x.Precision() would be 1.

Previously we would take only precision without also considering the
exponent, meaning you would have scenarios like 200 being formatted with
`%.2f` as just `200` as `x.exp` would be 2, and `x.Precision()` would be 1.
@ericlagergren
Copy link
Owner

hi, just letting you know I did see this issue.

I really appreciate the PR and I plan on merging it in.

@ericlagergren ericlagergren merged commit 88212e6 into ericlagergren:master Dec 6, 2019
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.

2 participants