vend-number
Advanced tools
Comparing version 3.1.0 to 3.1.2
declare module 'vend-number' { | ||
import { BigNumber, RoundingMode } from 'bignumber.js' | ||
import { BigNumber } from 'bignumber.js' | ||
@@ -8,3 +8,40 @@ interface Stringable { | ||
declare export default class VendNumber extends BigNumber { | ||
// RoundingMode is not exported in bignumber.js 5.0.0 so have to copy and paste the declaration from bignumber.js to | ||
// here in order to use the type. RoundingMode is available in bignumber.js 6.0.0+ | ||
enum RoundingMode { | ||
/** Rounds away from zero */ | ||
ROUND_UP = 0, | ||
/** Rounds towards zero */ | ||
ROUND_DOWN = 1, | ||
/** Rounds towards Infinity */ | ||
ROUND_CEIL = 2, | ||
/** Rounds towards -Infinity */ | ||
ROUND_FLOOR = 3, | ||
/** | ||
* Rounds towards nearest neighbour. If equidistant, rounds away from zero | ||
*/ | ||
ROUND_HALF_UP = 4, | ||
/** | ||
* Rounds towards nearest neighbour. If equidistant, rounds towards zero | ||
*/ | ||
ROUND_HALF_DOWN = 5, | ||
/** | ||
* Rounds towards nearest neighbour. If equidistant, rounds towards even neighbour | ||
*/ | ||
ROUND_HALF_EVEN = 6, | ||
/** | ||
* Rounds towards nearest neighbour. If equidistant, rounds towards `Infinity` | ||
*/ | ||
ROUND_HALF_CEIL = 7, | ||
/** | ||
* Rounds towards nearest neighbour. If equidistant, rounds towards `-Infinity` | ||
*/ | ||
ROUND_HALF_FLOOR = 8, | ||
/** | ||
* The remainder is always positive. Euclidian division: `q = sign(n) * floor(a / abs(n))` | ||
*/ | ||
EUCLID = 9 | ||
} | ||
export default class VendNumber extends BigNumber { | ||
constructor (value?: Stringable) | ||
@@ -11,0 +48,0 @@ |
{ | ||
"name": "vend-number", | ||
"version": "3.1.0", | ||
"version": "3.1.2", | ||
"description": "A collection of utility methods for floating point Number operations", | ||
@@ -5,0 +5,0 @@ "main": "dist/vend-number.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1021
0
46689
9