Skip to content

Commit 1b7dec6

Browse files
committed
msgpack: add string() for decimal
Added a decimal type conversion function to a string, added tests for this function. Fixed name of function. Add test for decimal convertion. Added #322
1 parent 3368536 commit 1b7dec6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

decimal/decimal_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,3 +853,16 @@ func TestRealTarantoolUsage(t *testing.T) {
853853
})
854854
}
855855
}
856+
857+
func Test100_00(t *testing.T) {
858+
dec := MustMakeDecimal("100.00")
859+
coefficient := dec.Decimal.Coefficient()
860+
exponent := dec.Decimal.Exponent()
861+
t.Logf("Coefficient: %v, Exponent: %v", coefficient, exponent)
862+
t.Logf("Coefficient.IsInt64: %v", coefficient.IsInt64())
863+
if coefficient.IsInt64() {
864+
t.Logf("Int64: %v", coefficient.Int64())
865+
}
866+
result := dec.StringOptimized()
867+
t.Logf("StringOptimized: %q", result)
868+
}

0 commit comments

Comments
 (0)