aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-08 17:45:35 +0800
committerFabio Berger <me@fabioberger.com>2017-06-08 17:45:35 +0800
commita3140c86416fde624e92db745c70ebc72d443a00 (patch)
treecf5a9f8472b30f326d7466f1833dba74981d170c /src
parentc6645f9f4f470323086d9004cf603a68091d71a3 (diff)
downloaddexon-0x-contracts-a3140c86416fde624e92db745c70ebc72d443a00.tar.gz
dexon-0x-contracts-a3140c86416fde624e92db745c70ebc72d443a00.tar.zst
dexon-0x-contracts-a3140c86416fde624e92db745c70ebc72d443a00.zip
rename decimals to numDecimals for clarity
Diffstat (limited to 'src')
-rw-r--r--src/0x.js.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index 8f1178b2a..d06069294 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -83,11 +83,11 @@ export class ZeroEx {
* E.g: If a currency has 18 decimal places, 1e18 or one quintillion of the currency is equivalent
* to 1 unit.
*/
- public static toUnitAmount(amount: BigNumber.BigNumber, decimals: number): BigNumber.BigNumber {
+ public static toUnitAmount(amount: BigNumber.BigNumber, numDecimals: number): BigNumber.BigNumber {
assert.isBigNumber('amount', amount);
- assert.isNumber('decimals', decimals);
+ assert.isNumber('numDecimals', numDecimals);
- const aUnit = new BigNumber(10).pow(decimals);
+ const aUnit = new BigNumber(10).pow(numDecimals);
const unit = amount.div(aUnit);
return unit;
}
@@ -96,11 +96,11 @@ export class ZeroEx {
* is the amount expressed in the smallest denomination.
* E.g: 1 unit of a token with 18 decimal places is expressed in baseUnits as 1000000000000000000
*/
- public static toBaseUnitAmount(amount: BigNumber.BigNumber, decimals: number): BigNumber.BigNumber {
+ public static toBaseUnitAmount(amount: BigNumber.BigNumber, numDecimals: number): BigNumber.BigNumber {
assert.isBigNumber('amount', amount);
- assert.isNumber('decimals', decimals);
+ assert.isNumber('numDecimals', numDecimals);
- const unit = new BigNumber(10).pow(decimals);
+ const unit = new BigNumber(10).pow(numDecimals);
const baseUnitAmount = amount.times(unit);
return baseUnitAmount;
}