Skip to content

Commit

Permalink
string
Browse files Browse the repository at this point in the history
  • Loading branch information
leohhhn committed May 17, 2024
1 parent c3c6db0 commit f58fe4d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gnovm/stdlibs/std/coins.gno
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import (
"strconv"
)

// NOTE: this is selectly copied over from pkgs/std/coin.go
// TODO: import all functionality(?).
// TODO: implement Coin/Coins constructors.
// NOTE: this is selectively copied over from tm2/pkgs/std/coin.go

// Coin hold some amount of one currency.
// A negative amount is invalid.
Expand All @@ -26,7 +24,7 @@ func NewCoin(denom string, amount int64) Coin {
// String provides a human-readable representation of a coin
func (c Coin) String() string {
if c.IsZero() {
return ""
return "0" + c.Denom
}

return strconv.Itoa(int(c.Amount)) + c.Denom
Expand Down

0 comments on commit f58fe4d

Please sign in to comment.