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

R4R: Sortable Decimal Bytes #5360

Merged
merged 10 commits into from
Dec 5, 2019
Prev Previous commit
Next Next commit
removed extra comments
  • Loading branch information
sunnya97 committed Dec 3, 2019
commit 5cf673b97a527faea289f3ed39541db1b03d6b2b
3 changes: 0 additions & 3 deletions types/decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,6 @@ func ValidSortableDec(dec Dec) bool {
return dec.LTE(OneDec().Quo(SmallestDec()))
}

// FormattingStringSortableBytes is the string used in Sprintf to left and right pad the sdk.Dec
// It adjusts based on the Precision constant

// Returns a byte slice representation of an sdk.Dec that can be sorted.
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
// Left and right pads with 0s so there are 18 digits to left and right of decimal point
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
// For this reason, there is a maximum and minimum value for this, enforced by ValidSortableDec
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
Expand Down