Skip to content

Commit

Permalink
fix: add formatter to createBigjdDinero
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhooks committed Feb 18, 2023
1 parent bbd1eb9 commit dff300e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/utils/createBigjsDinero.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Big from 'big.js';
import { Big } from 'big.js';

import { createDinero } from 'dinero.js';
import type { DineroOptions, ComparisonOperator } from 'dinero.js';
Expand All @@ -16,6 +16,10 @@ const dinero = createDinero({
subtract: (a, b) => a.minus(b),
zero: () => new Big(0),
},
formatter: {
toNumber: (v) => v.toNumber(),
toString: (v) => v.toFixed(),
},
});

export function createBigjsDinero(options: DineroOptions<Big>) {
Expand Down

0 comments on commit dff300e

Please sign in to comment.