Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@helium/currency

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@helium/currency - npm Package Compare versions

Comparing version 4.7.0 to 4.7.2

1

build/Balance.d.ts

@@ -8,2 +8,3 @@ import BigNumber from 'bignumber.js';

showTicker?: boolean;
roundingMode?: BigNumber.RoundingMode;
};

@@ -10,0 +11,0 @@ export default class Balance<T extends BaseCurrencyType> {

14

build/Balance.js

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/* eslint-disable prefer-destructuring */
const bignumber_js_1 = __importDefault(require("bignumber.js"));

@@ -41,8 +42,13 @@ const CurrencyType_1 = __importDefault(require("./CurrencyType"));

const showTicker = (options === null || options === void 0 ? void 0 : options.showTicker) === undefined ? true : options.showTicker;
let numberString = maxDecimalPlaces !== undefined && maxDecimalPlaces !== null
? this.bigBalance.toFormat(maxDecimalPlaces, { decimalSeparator, groupSeparator, groupSize: 3 })
: this.bigBalance.toFormat({ decimalSeparator, groupSeparator, groupSize: 3 });
const format = { decimalSeparator, groupSeparator, groupSize: 3 };
let numberString = '';
if (maxDecimalPlaces !== undefined && maxDecimalPlaces !== null) {
numberString = this.bigBalance.toFormat(maxDecimalPlaces, (options === null || options === void 0 ? void 0 : options.roundingMode) || bignumber_js_1.default.ROUND_DOWN, format);
}
else {
numberString = this.bigBalance.toFormat(format);
}
// if it's an integer, just show the integer
if (parseInt(numberString.split(decimalSeparator)[1], 10) === 0) {
[numberString] = numberString.split(decimalSeparator);
numberString = numberString.split(decimalSeparator)[0];
}

@@ -49,0 +55,0 @@ // if the rounded amount is 0, then show the full amount

{
"name": "@helium/currency",
"version": "4.7.0",
"version": "4.7.2",
"description": "Utilities for handling different currency types on the Helium blockchain",

@@ -31,3 +31,3 @@ "keywords": [

},
"gitHead": "20d7cf8f2002f3962dce732bf4c1f0ef7e88b6f7"
"gitHead": "b5129be245f5c911a89c69f38f3039c196de2de7"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc