Skip to content

Commit

Permalink
fix divDecimals
Browse files Browse the repository at this point in the history
  • Loading branch information
puncsky committed Oct 17, 2023
1 parent 140cb85 commit be6aeab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/service/utils/div-decimals.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import config from "config";
import { BigNumber } from "ethers";
import { ethers } from "ethers";

export function divDecimals(
num: string | number | null | undefined,
Expand All @@ -11,5 +11,5 @@ export function divDecimals(
if (!decimals) {
return String(num);
}
return BigNumber.from(num).div(BigNumber.from(10).pow(decimals)).toString();
return ethers.utils.formatUnits(num, decimals);
}

0 comments on commit be6aeab

Please sign in to comment.