-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc413f8
commit e88b4b1
Showing
25 changed files
with
1,770 additions
and
823 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import BigNumber from 'bignumber.js'; | ||
|
||
export type BigNumberish = number | string | BigNumber; | ||
|
||
export const convertRawAmountToDecimalFormat = ( | ||
value: BigNumberish, | ||
decimals = 18, | ||
): string => | ||
new BigNumber(value).dividedBy(new BigNumber(10).pow(decimals)).toFixed(); | ||
|
||
export const subtract = ( | ||
numberOne: BigNumberish, | ||
numberTwo: BigNumberish, | ||
): string => new BigNumber(numberOne).minus(new BigNumber(numberTwo)).toFixed(); |
Oops, something went wrong.