Conversation
… instead of a whole number
Contributor
Author
|
@yegor256 take a look please, happy to clarify anything about this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the fix for #1026,
Fbe::Award::Bill#linerounded every Float in${...}to a whole number. That removed the floating point noise, but it also turned a rate of 0.05 into 0, so the bill said "at 0 points each" while the bylaw of the same policy said 0.05, as #1219 shows.Now a Float in the text of a bill line is rounded to two decimals, and the fraction is dropped when it is zero. The case from #1026 still reads "2 days", a rate reads "0.05", and a tiny negative value reads "0", not "-0.0". The points themselves are still rounded by
whole, as before.One visible change: the
resolved-bug-was-rewardedbylaw now tells a contributor "12.5 days of delay" where it said "13 days" for 300 hours.The new tests cover a random rate, a negative rate, a third rounded to 0.33, a whole Float printed without a fraction, and a tiny negative Float printed as zero.
Closes #1219