Skip to content

Commit 338c283

Browse files
committed
msgpack: add string() for decimal, datetime. interval
Added a benchmark, which shows that the code for decimal is optimized two or more times for string conversion than the code from the library. Added a datetime, Interval type conversion function to a string, added tests for this function. Added #322
1 parent f4265e1 commit 338c283

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

decimal/decimal.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ func (d Decimal) stringFromInt64(value int64, scale int) string {
214214
// Numbers like 0.00123.
215215
// Count trailing zeros in the fractional part.
216216
trailingZeros := 0
217-
// In this case, the fractional part consists of (scale-length) zeros followed by the number.
217+
// In this case, the fractional part consists
218+
// of (scale-length) zeros followed by the number.
218219
// We need to count trailing zeros in the actual number part.
219220
for i := length - 1; i >= 0 && str[i] == '0'; i-- {
220221
trailingZeros++

0 commit comments

Comments
 (0)