Skip to content

Commit

Permalink
selfrev: better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pysel committed Sep 6, 2023
1 parent 177d47e commit 3e66b05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osmomath/decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ func (d BigDec) DecWithPrecision(precision int64) Dec {
}

// ChopPrecisionMut truncates all decimals after precision numbers after decimal point. Mutative
// CONTRACT: prec <= PrecisionBigDec
// CONTRACT: precision <= PrecisionBigDec
func (d *BigDec) ChopPrecisionMut(precision int64) BigDec {
precisionFactor := new(big.Int).Exp(big.NewInt(10), big.NewInt(PrecisionBigDec-precision), nil)
// big.Quo truncates numbers that would have been after decimal point
Expand All @@ -598,7 +598,7 @@ func (d *BigDec) ChopPrecisionMut(precision int64) BigDec {
}

// ChopPrecision truncates all decimals after precision numbers after decimal point
// CONTRACT: prec <= PrecisionBigDec
// CONTRACT: precision <= PrecisionBigDec
func (d *BigDec) ChopPrecision(precision int64) BigDec {
copy := d.Clone()
return copy.ChopPrecisionMut(precision)
Expand Down

0 comments on commit 3e66b05

Please sign in to comment.