We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba7fdc4 commit 1d9d0b3Copy full SHA for 1d9d0b3
1 file changed
client/v2/autocli/query.go
@@ -206,12 +206,12 @@ func encoder(encoder aminojson.Encoder) aminojson.Encoder {
206
}
207
208
amount := msg.Get(amountField).String()
209
- if len(amount) > math.LegacyPrecision {
210
- amount = amount[:len(amount)-math.LegacyPrecision] + "." + amount[len(amount)-math.LegacyPrecision:]
211
- } else if len(amount) == math.LegacyPrecision {
+ decimalPlace := len(amount) - math.LegacyPrecision
+ if decimalPlace > 0 {
+ amount = amount[:decimalPlace] + "." + amount[decimalPlace:]
212
+ } else if decimalPlace == 0 {
213
amount = "0." + amount
214
} else {
- decimalPlace := len(amount) - math.LegacyPrecision
215
amount = "0." + strings.Repeat("0", -decimalPlace) + amount
216
217
0 commit comments