Skip to content

Commit

Permalink
Update Decimal Format()
Browse files Browse the repository at this point in the history
  • Loading branch information
jaekwon committed Nov 24, 2018
1 parent c0239e0 commit 4959289
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions types/decimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ func (d Dec) IsInteger() bool {
return new(big.Int).Rem(d.Int, precisionReuse).Sign() == 0
}

func (d Dec) Format(s fmt.State, verb rune) {
s.Write([]byte(d.String()))
}

func (d Dec) String() string {
bz, err := d.Int.MarshalText()
if err != nil {
Expand Down

0 comments on commit 4959289

Please sign in to comment.