github.com/InjectiveLabs/sdk-go@v1.53.0/client/core/token.go (about)

     1  package core
     2  
     3  import "github.com/shopspring/decimal"
     4  
     5  type Token struct {
     6  	Name     string
     7  	Symbol   string
     8  	Denom    string
     9  	Address  string
    10  	Decimals int32
    11  	Logo     string
    12  	Updated  int64
    13  }
    14  
    15  func (t Token) ChainFormattedValue(humanReadableValue decimal.Decimal) decimal.Decimal {
    16  	multiplier := decimal.New(1, t.Decimals)
    17  	return humanReadableValue.Mul(multiplier)
    18  }