Skip to content

Commit

Permalink
fix RoundCeil/RoundFLoor negative value example
Browse files Browse the repository at this point in the history
  • Loading branch information
ducille committed Jan 30, 2024
1 parent c1fe20e commit 0a374d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ func (d Decimal) RoundCash(interval uint8) Decimal {
// NewFromFloat(545).RoundCeil(-2).String() // output: "600"
// NewFromFloat(500).RoundCeil(-2).String() // output: "500"
// NewFromFloat(1.1001).RoundCeil(2).String() // output: "1.11"
// NewFromFloat(-1.454).RoundCeil(1).String() // output: "-1.5"
// NewFromFloat(-1.454).RoundCeil(1).String() // output: "-1.4"
func (d Decimal) RoundCeil(places int32) Decimal {
return newFromDecimal(d.asFallback().RoundCeil(places))
}
Expand All @@ -736,7 +736,7 @@ func (d Decimal) RoundDown(places int32) Decimal {
// NewFromFloat(545).RoundFloor(-2).String() // output: "500"
// NewFromFloat(-500).RoundFloor(-2).String() // output: "-500"
// NewFromFloat(1.1001).RoundFloor(2).String() // output: "1.1"
// NewFromFloat(-1.454).RoundFloor(1).String() // output: "-1.4"
// NewFromFloat(-1.454).RoundFloor(1).String() // output: "-1.5"
func (d Decimal) RoundFloor(places int32) Decimal {
return newFromDecimal(d.asFallback().RoundFloor(places))
}
Expand Down

0 comments on commit 0a374d0

Please sign in to comment.