本文整理汇总了TypeScript中bignumber.js.default.dividedBy方法的典型用法代码示例。如果您正苦于以下问题:TypeScript js.default.dividedBy方法的具体用法?TypeScript js.default.dividedBy怎么用?TypeScript js.default.dividedBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bignumber.js.default
的用法示例。
在下文中一共展示了js.default.dividedBy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: return
return this._usdEthRate().then(usdEthRate => {
const ethAmount = usdAmount.dividedBy(usdEthRate);
console.log('ethamount', ethAmount);
return (
ethAmount
//.multipliedBy(web3.utils.unitMap.ether)
.mul('1000000000000000000')
.dividedToIntegerBy(1)
);
});
示例2: BigNumber
x.comparedTo(x.minus(1)) // 0
y.cmp(NaN) // null
y.cmp('110', 2) // -1
}
{
const x = new BigNumber(123.45)
x.decimalPlaces() // 2
const y = new BigNumber('9.9e-101')
y.dp() // 102
}
{
const x = new BigNumber(355)
const y = new BigNumber(113)
x.dividedBy(y) // '3.14159292035398230088'
x.div(5) // '71'
x.div(47, 16) // '5'
}
{
const x = new BigNumber(5)
const y = new BigNumber(3)
x.dividedToIntegerBy(y) // '1'
x.divToInt(0.7) // '7'
x.divToInt('0.f', 16) // '5'
}
{
0 === 1e-324 // true
const x = new BigNumber(0)
示例3: BigNumber
import BigNumber from "bignumber.js";
export interface Precision {
decimals: number;
limit: string;
zero: string;
multiple: string;
}
const ten = new BigNumber(10, 10);
const decimals = new BigNumber(18, 10);
const multiple: BigNumber = ten.exponentiatedBy(decimals.toNumber());
export const PRECISION: Precision = {
decimals: decimals.toNumber(),
limit: ten.dividedBy(multiple).toString(),
zero: new BigNumber(1, 10).dividedBy(multiple).toString(),
multiple: multiple.toString(),
};
// WARNING: Update this only if this release requires destroying all existing Augur Node Databases
export const DB_VERSION = 4;
export const DB_FILE = "augur-%s-%s.db";
export const DB_WARP_SYNC_FILE = "%s-%s-%s.warp";
export const DB_WARP_SYNC_FILE_ENDING = "-%s-%s.warp";
export const DUMP_EVERY_BLOCKS = 100;
export const ETHER = "ether";
export const MINIMUM_TRADE_SIZE = "0.000001";
export const BN_WEI_PER_ETHER: BigNumber = new BigNumber(10, 10).exponentiatedBy(18);
示例4:
return this._usdEthRate().then(usdEthRate => {
const ethAmount = weiAmount.dividedBy(web3.utils.unitMap.ether);
return ethAmount.multipliedBy(usdEthRate);
});
示例5: fixedPointToDecimal
export function fixedPointToDecimal(fixedPointValue: BigNumber, conversionFactor: BigNumber): BigNumber {
return fixedPointValue.dividedBy(conversionFactor);
}