diff options
author | Jacob Evans <dekz@dekz.net> | 2018-07-02 09:21:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-02 09:21:16 +0800 |
commit | ad570b8ae162a213b4b88c417ecd64d4661df18b (patch) | |
tree | d9acfb9e2459c4dfcac191061fefebe015ff5771 /packages/order-utils/src/utils.ts | |
parent | b9165c03af40983d885af2b18e729f11746de91d (diff) | |
parent | b9b00e10d39c3c84bc72892ef37f1313e904414d (diff) | |
download | dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.tar dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.tar.gz dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.tar.bz2 dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.tar.lz dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.tar.xz dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.tar.zst dexon-sol-tools-ad570b8ae162a213b4b88c417ecd64d4661df18b.zip |
Merge branch 'v2-prototype' into eth-lightwallet-subprovider-final
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; + }, }; |