Skip to content

Commit

Permalink
Merge pull request #45 from vend/ap--rounding-modes-export
Browse files Browse the repository at this point in the history
Expose ROUNDING MODES
  • Loading branch information
aarr0n authored Nov 6, 2023
2 parents 05ee7d4 + be8d196 commit 203a192
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,22 @@ declare module 'vend-number' {
EUCLID = 9
}

export const ROUNDING_MODES = {
ROUND_UP: RoundingMode.ROUND_UP,
ROUND_DOWN: RoundingMode.ROUND_DOWN,
ROUND_CEIL: RoundingMode.ROUND_CEIL,
ROUND_FLOOR: RoundingMode.ROUND_FLOOR,
ROUND_HALF_UP: RoundingMode.ROUND_HALF_UP,
ROUND_HALF_DOWN: RoundingMode.ROUND_HALF_DOWN,
ROUND_HALF_EVEN: RoundingMode.ROUND_HALF_EVEN,
ROUND_HALF_CEIL: RoundingMode.ROUND_HALF_CEIL,
ROUND_HALF_FLOOR: RoundingMode.ROUND_HALF_FLOOR,
} as const

export default class VendNumber extends BigNumber {
constructor (value?: Stringable)

static readonly ROUNDING_MODES: {
ROUND_UP: RoundingMode,
ROUND_DOWN: RoundingMode,
ROUND_CEIL: RoundingMode,
ROUND_FLOOR: RoundingMode,
ROUND_HALF_UP: RoundingMode,
ROUND_HALF_DOWN: RoundingMode,
ROUND_HALF_EVEN: RoundingMode,
ROUND_HALF_CEIL: RoundingMode,
ROUND_HALF_FLOOR: RoundingMode
}
static readonly ROUNDING_MODES: typeof ROUNDING_MODES

static vn(value?: Stringable): VendNumber
static round(value?: Stringable, decimalPoints?: number, roundingMode?: RoundingMode): string
Expand Down

0 comments on commit 203a192

Please sign in to comment.