MCPcopy Create free account
hub / github.com/dbProjectRED/redimo.go / Int

Method Int

values.go:88–97  ·  view source on GitHub ↗

Int returns the value as int64. Will be zero-valued if the value is not actually numeric. The value was originally a float, it will be truncated.

()

Source from the content-addressed store, hash-verified

86// Int returns the value as int64. Will be zero-valued if the value is not actually numeric. The value was originally
87// a float, it will be truncated.
88func (rv ReturnValue) Int() int64 {
89 if aws.StringValue(rv.av.N) == "" {
90 return 0
91 }
92
93 f, _, _ := new(big.Float).Parse(aws.StringValue(rv.av.N), 10)
94 i, _ := f.Int64()
95
96 return i
97}
98
99// Float returns the value as float64. Will be zero-valued if the value is not numeric. If the value
100// was originally stored as an int, it will be converted to float64 based on parsing the string

Callers 6

INCRBYMethod · 0.80
TestHashCountersFunction · 0.80
TestBasicFunction · 0.80
LLENMethod · 0.80
TestValuesFunction · 0.80
HINCRBYMethod · 0.80

Calls

no outgoing calls

Tested by 3

TestHashCountersFunction · 0.64
TestBasicFunction · 0.64
TestValuesFunction · 0.64