Skip to content

Commit

Permalink
Merge pull request #59 from Gearbox-protocol/fix-formatters
Browse files Browse the repository at this point in the history
fix: formatBN
  • Loading branch information
essserrr authored Oct 6, 2023
2 parents bd18230 + 4307f3c commit ac519f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export const percentFmt = (v: number): string =>
`${(v / 100).toFixed(2)}% [ ${v} ]`;

export function formatBN(
num: bigint,
num: BigNumberish | undefined,
decimals: number,
precision?: number,
): string {
if (num === undefined) return "-";

const numBInt = toBigInt(num);
// GUSD: 2 decimals
const limitedNum = limitNum(num, decimals);
const limitedNum = limitNum(numBInt, decimals);
const limitedPrecision = limitPrecision(limitedNum, precision);
return toHumanFormat(limitedNum, limitedPrecision);
}
Expand Down

0 comments on commit ac519f3

Please sign in to comment.