We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5455f70 commit ba7fdc4Copy full SHA for ba7fdc4
1 file changed
client/v2/autocli/query.go
@@ -4,6 +4,7 @@ import (
4
"context"
5
"fmt"
6
"io"
7
+ "strings"
8
"time"
9
10
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
@@ -205,8 +206,13 @@ func encoder(encoder aminojson.Encoder) aminojson.Encoder {
205
206
}
207
208
amount := msg.Get(amountField).String()
- if len(amount) >= math.LegacyPrecision {
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 {
212
+ amount = "0." + amount
213
+ } else {
214
+ decimalPlace := len(amount) - math.LegacyPrecision
215
+ amount = "0." + strings.Repeat("0", -decimalPlace) + amount
216
217
218
amountDec, err := math.LegacyNewDecFromStr(amount)
0 commit comments