How to use the maximum function from bignumber.js

Find comprehensive JavaScript bignumber.js.maximum code examples handpicked from public code repositorys.

935
936
937
938
939
940
941
942
943
944
 * 返回给定键的最大值
 */
max(key) {
    // 获取值
    const nums = getNums.call(this, key)
    return nums.length ? BigNumber.maximum(...nums).toNumber() : 0
}

/**
 * 返回给定键的最小值
fork icon0
star icon2
watch icon2

+ 8 other calls in file

70
71
72
73
74
75
76
77
78
79

const tokens = MINTS.reduce((acc, token, i) => {
  const { mintAddress, decimals } = token;
  const depositTotal = numberToFixed(convertFromBN(data.balancesMap[mintAddress].depositTotal, INTERNAL_DECIMALS), decimals);
  const borrowTotal = numberToFixed(convertFromBN(data.balancesMap[mintAddress].borrowTotal, INTERNAL_DECIMALS), decimals);
  const available = BigNumber.maximum(new BigNumber(depositTotal).minus(borrowTotal), 0);
  const price = convertFromBN(data.pricesMap[mintAddress], INTERNAL_DECIMALS);

  acc[mintAddress] = {
    borrowed: {
fork icon0
star icon0
watch icon0