Skip to content

Commit

Permalink
chore: strip trailing digits to 6 in amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Sep 21, 2023
1 parent 8dbd5d5 commit 3edd060
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/reporters/telegram/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ func (reporter *TelegramReporter) SerializeAmount(amount amount.Amount) template
if amount.PriceUSD == nil {
return template.HTML(fmt.Sprintf(
"%s %s",
humanize.BigCommaf(amount.Value),
utils.StripTrailingDigits(humanize.BigCommaf(amount.Value), 6),
amount.Denom,
))
}

return template.HTML(fmt.Sprintf(
"%s %s ($%s)",
humanize.BigCommaf(amount.Value),
utils.StripTrailingDigits(humanize.BigCommaf(amount.Value), 6),
amount.Denom,
utils.StripTrailingDigits(humanize.BigCommaf(amount.PriceUSD), 3),
))
Expand Down

0 comments on commit 3edd060

Please sign in to comment.