diff --git a/core/coins/format.go b/core/coins/format.go index 315c96d78f46..7b1e49f2b7e2 100644 --- a/core/coins/format.go +++ b/core/coins/format.go @@ -84,6 +84,11 @@ func FormatCoins(coins []*basev1beta1.Coin, metadata []*bankv1beta1.Metadata) (s if err != nil { return "", err } + // If a coin contains a comma, return an error given that the output + // could be misinterpreted by the user as 2 different coins. + if strings.Contains(formatted[i], ",") { + return "", fmt.Errorf("coin %s contains a comma", formatted[i]) + } } if len(coins) == 0 {