-
Notifications
You must be signed in to change notification settings - Fork 115
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
Unify pretty printing of quantity.Quantity fractions #3129
Conversation
d825fd2
to
6f38b2e
Compare
Set its base-10 exponent in commissionRateDenominatorExponent and use it to compute the CommissionRateDenominator.
Make ConvertToTokenAmount() and PrettyPrintCommissionRatePercentage() use the newly introduced FractionBase10 function. Add tests for PrettyPrintCommissionRatePercentage() and move it to go/staking/api/prettyprint.go.
6f38b2e
to
ae3c937
Compare
Codecov Report
@@ Coverage Diff @@
## master #3129 +/- ##
==========================================
+ Coverage 68.89% 68.98% +0.08%
==========================================
Files 373 374 +1
Lines 36986 36990 +4
==========================================
+ Hits 25481 25516 +35
+ Misses 8258 8235 -23
+ Partials 3247 3239 -8
Continue to review full report at Codecov.
|
|
||
// FractionBase10 returns a decimal representation of a fraction from fraction's | ||
// numerator and denominator's base-10 exponent. | ||
func FractionBase10(numerator quantity.Quantity, denominatorExp uint8) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another idea for the name is QuantityFraction()
...
No description provided.