Skip to content

Commit 7f6189e

Browse files
committed
fix comments
1 parent b3a9032 commit 7f6189e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

decimal/bcd.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ func EncodeStringToBCD(buf string) ([]byte, error) {
9090
c = -1
9191
}
9292

93-
// nibbleIdx is an index of a current nibble in a byte buffer. The first
94-
// nibble should contain 0, if the decimal number has an even number of
95-
// digits.
93+
// nibbleIdx is an index of a current nibble in a byte buffer.
9694
nibbleIdx := 0
9795
scale := 0 // By default decimal number is integer.
9896
var byteBuf []byte
@@ -146,6 +144,9 @@ func EncodeStringToBCD(buf string) ([]byte, error) {
146144
lowByte := len(byteBuf) - 1
147145
byteBuf[lowByte] = byteBuf[lowByte] | mapRuneToByteSign[sign]
148146
}
147+
148+
// The first nibble should contain 0, if the decimal number has an even
149+
// number of digits.
149150
byteScale := byte(scale)
150151
if c%2 == 0 {
151152
byteScale = byteScale << 4

0 commit comments

Comments
 (0)