diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-29 08:20:05 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-29 08:20:05 +0800 |
commit | e235a63119216525815430832ebf88fbef5e9259 (patch) | |
tree | 8b62a0dbc9871988b31db4228e8f18a500212717 /packages/order-utils/src/utils.ts | |
parent | c20549e88d710cb5b3577fae468545aa2d531370 (diff) | |
parent | 518a2da0275632a5dd61f99a105163ff5a074927 (diff) | |
download | dexon-sol-tools-e235a63119216525815430832ebf88fbef5e9259.tar dexon-sol-tools-e235a63119216525815430832ebf88fbef5e9259.tar.gz dexon-sol-tools-e235a63119216525815430832ebf88fbef5e9259.tar.bz2 dexon-sol-tools-e235a63119216525815430832ebf88fbef5e9259.tar.lz dexon-sol-tools-e235a63119216525815430832ebf88fbef5e9259.tar.xz dexon-sol-tools-e235a63119216525815430832ebf88fbef5e9259.tar.zst dexon-sol-tools-e235a63119216525815430832ebf88fbef5e9259.zip |
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/portal-onboarding-polish
Diffstat (limited to 'packages/order-utils/src/utils.ts')
-rw-r--r-- | packages/order-utils/src/utils.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/order-utils/src/utils.ts b/packages/order-utils/src/utils.ts index 6149316f6..7aaaf0609 100644 --- a/packages/order-utils/src/utils.ts +++ b/packages/order-utils/src/utils.ts @@ -12,4 +12,11 @@ export const utils = { const milisecondsInSecond = 1000; return new BigNumber(Date.now() / milisecondsInSecond).round(); }, + getPartialAmount(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber { + const fillMakerTokenAmount = numerator + .mul(target) + .div(denominator) + .round(0); + return fillMakerTokenAmount; + }, }; |