当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript bignumber.js.BigNumber类代码示例

本文整理汇总了TypeScript中bignumber.js.BigNumber的典型用法代码示例。如果您正苦于以下问题:TypeScript js.BigNumber类的具体用法?TypeScript js.BigNumber怎么用?TypeScript js.BigNumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了js.BigNumber类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: test

      test("equals, should return same value as BigNumber", () => {
        const input = new BigNumber(Number.MAX_VALUE);

        const output = new JavaBigDecimal(input.toString(10)).get();

        expect(output).toEqual(new BigNumber(Number.MAX_VALUE));
      });
开发者ID:droolsjbpm,项目名称:livespark,代码行数:7,代码来源:JavaBigDecimal.test.ts

示例2: BigNumber

 const volumes = _.reduce(marketOutcomes, (acc, trade) => {
   const tradeAmount = new BigNumber(trade.amount);
   const tradePrice = new BigNumber(trade.price);
   const price = tradePrice.minus(minPrice);
   return {
     shareVolume: acc.shareVolume.plus(tradeAmount),
     volume: acc.volume.plus(tradeAmount.multipliedBy(price)),
   };
 }, { shareVolume: ZERO, volume: ZERO });
开发者ID:AugurProject,项目名称:augur_node,代码行数:9,代码来源:20180907121300_outcome_market_share_volume.ts

示例3: increaseApprovalTx

 public increaseApprovalTx(
   _spender: BigNumber | string,
   _addedValue: BigNumber | number
 ): DeferredTransactionWrapper<ITxParams> {
   return new DeferredTransactionWrapper<ITxParams>(this, "increaseApproval", [
     _spender.toString(),
     _addedValue.toString()
   ]);
 }
开发者ID:8001800,项目名称:spankbank,代码行数:9,代码来源:MintableToken.ts

示例4: allowanceTx

 public allowanceTx(
   owner: BigNumber | string,
   spender: BigNumber | string
 ): DeferredTransactionWrapper<ITxParams> {
   return new DeferredTransactionWrapper<ITxParams>(this, "allowance", [
     owner.toString(),
     spender.toString()
   ]);
 }
开发者ID:8001800,项目名称:spankbank,代码行数:9,代码来源:ERC20.ts

示例5: mintTx

 public mintTx(
   _to: BigNumber | string,
   _amount: BigNumber | number
 ): DeferredTransactionWrapper<ITxParams> {
   return new DeferredTransactionWrapper<ITxParams>(this, "mint", [
     _to.toString(),
     _amount.toString()
   ]);
 }
开发者ID:8001800,项目名称:spankbank,代码行数:9,代码来源:MintableToken.ts

示例6: approveTx

 public approveTx(
   _spender: BigNumber | string,
   _value: BigNumber | number
 ): DeferredTransactionWrapper<ITxParams> {
   return new DeferredTransactionWrapper<ITxParams>(this, "approve", [
     _spender.toString(),
     _value.toString()
   ]);
 }
开发者ID:8001800,项目名称:spankbank,代码行数:9,代码来源:Token.ts

示例7: allowance

 public allowance(
   _owner: BigNumber | string,
   _spender: BigNumber | string
 ): Promise<BigNumber> {
   return promisify(this.rawWeb3Contract.allowance, [
     _owner.toString(),
     _spender.toString()
   ]);
 }
开发者ID:8001800,项目名称:spankbank,代码行数:9,代码来源:Token.ts

示例8: transferTx

 public transferTx(
   _to: BigNumber | string,
   _value: BigNumber | number
 ): DeferredTransactionWrapper<ITxParams> {
   return new DeferredTransactionWrapper<ITxParams>(this, "transfer", [
     _to.toString(),
     _value.toString()
   ]);
 }
开发者ID:8001800,项目名称:spankbank,代码行数:9,代码来源:Token.ts

示例9: getDidClaimBooty

 public getDidClaimBooty(
   stakerAddress: BigNumber | string,
   period: BigNumber | number
 ): Promise<boolean> {
   return promisify(this.rawWeb3Contract.getDidClaimBooty, [
     stakerAddress.toString(),
     period.toString()
   ]);
 }
开发者ID:8001800,项目名称:spankbank,代码行数:9,代码来源:SpankBank.ts

示例10: cssClass

 cssClass(): string {
   if (this.amount.greaterThan(0.0)) {
     return 'positive';
   } else if (this.amount.lessThan(0.0)) {
     return 'negative';
   } else {
     return 'zero';
   }
 }
开发者ID:gaborfeher,项目名称:grantmaster,代码行数:9,代码来源:FormattedAmount.ts


注:本文中的bignumber.js.BigNumber类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。