aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/src/utils.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-29 02:13:19 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-29 02:17:30 +0800
commite4188f5d4c38e53bf6966a364da41a3aa164b567 (patch)
treeac24b29f975be088a9d3d391f8a73acc7ad14aba /packages/order-utils/src/utils.ts
parent360927ec77d5ea50848f4c1b2c66566542a28d1c (diff)
parent0fcbd02d50bd564a9c888f247a4b0a565d928cc6 (diff)
downloaddexon-sol-tools-e4188f5d4c38e53bf6966a364da41a3aa164b567.tar
dexon-sol-tools-e4188f5d4c38e53bf6966a364da41a3aa164b567.tar.gz
dexon-sol-tools-e4188f5d4c38e53bf6966a364da41a3aa164b567.tar.bz2
dexon-sol-tools-e4188f5d4c38e53bf6966a364da41a3aa164b567.tar.lz
dexon-sol-tools-e4188f5d4c38e53bf6966a364da41a3aa164b567.tar.xz
dexon-sol-tools-e4188f5d4c38e53bf6966a364da41a3aa164b567.tar.zst
dexon-sol-tools-e4188f5d4c38e53bf6966a364da41a3aa164b567.zip
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/support-new-metamask
Diffstat (limited to 'packages/order-utils/src/utils.ts')
-rw-r--r--packages/order-utils/src/utils.ts7
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;
+ },
};