bigdecimal.js
Advanced tools
@@ -1054,13 +1054,13 @@ /** | ||
| *```javascript | ||
| * // Single unified constructor for multiple values | ||
| * const { Big } = require('bigdecimal.js'); | ||
| * | ||
| * // Constructor accepts any value such as string and BigDecimal itself: | ||
| * // Construct from a string and clone it | ||
| * const x = Big('1.1111111111111111111111'); | ||
| * const y = Big(x); | ||
| * const y = new Big(x); // you can also use 'new' | ||
| * | ||
| * // You can do arithmetic operations | ||
| * const z = x.add(y); | ||
| * console.log(z.toString()); // 2.2222222222222222222222 | ||
| * | ||
| * // You can also construct a BigDecimal from a number or a BigInt: | ||
| * // You can also construct from a number or BigInt: | ||
| * const u = Big(1.1); | ||
@@ -1067,0 +1067,0 @@ * const v = Big(2n); |
+1
-1
| { | ||
| "name": "bigdecimal.js", | ||
| "version": "1.1.2", | ||
| "version": "1.1.3", | ||
| "description": "A BigDecimal implementation with native BigInts", | ||
@@ -5,0 +5,0 @@ "exports": { |
+5
-6
@@ -30,7 +30,6 @@ # BigDecimal.js | ||
| ```javascript | ||
| // Single unified constructor for multiple values | ||
| const { Big } = require('bigdecimal.js'); | ||
| // Single constructor for all values | ||
| // Construct from a string and copy it | ||
| // Construct from a string and clone it | ||
| const x = Big('1.1111111111111111111111'); | ||
@@ -43,3 +42,2 @@ const y = new Big(x); // you can also use 'new' | ||
| // You can also construct from a number or BigInt: | ||
| const u = Big(1.1); | ||
@@ -60,6 +58,7 @@ const v = Big(2n); | ||
| const res1 = x.divide(y, MC(3)); // MC is MathContext constructor that can be used without `new` | ||
| // MC is MathContext constructor that can be used with or without `new` | ||
| const res1 = x.divideWithMathContext(y, MC(3)); | ||
| console.log(res1.toString()); // 0.333 | ||
| const res2 = x.divide(y, new MC(3, RoundingMode.UP)); | ||
| const res2 = x.divideWithMathContext(y, new MC(3, RoundingMode.UP)); | ||
| console.log(res2.toString()); // 0.334 | ||
@@ -66,0 +65,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
424025
0.01%123
-0.81%