Skip to content

Commit

Permalink
Fix formatNumber helper (#56)
Browse files Browse the repository at this point in the history
fix formatNumber helper
  • Loading branch information
lukachi authored Mar 14, 2024
1 parent 17d43b9 commit a2c5bfa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/helpers/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ function convertNumberWithPrefix(value: string) {
export function formatNumber(value: number, formatConfig?: BnFormatConfig) {
const formatCfg = formatConfig || {
...defaultBnFormatConfig,
decimals: 0,
}

return BN.fromRaw(value, 0).format(formatCfg)
return removeTrailingZeros(BN.fromRaw(value).format(formatCfg))
}

export function formatAmount(
Expand Down

0 comments on commit a2c5bfa

Please sign in to comment.