From dff300ed16f46c156d09bc02450162a4a6e5bc9c Mon Sep 17 00:00:00 2001 From: John Hooks Date: Sat, 18 Feb 2023 11:37:24 -0800 Subject: [PATCH] fix: add formatter to createBigjdDinero --- test/utils/createBigjsDinero.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/utils/createBigjsDinero.ts b/test/utils/createBigjsDinero.ts index 08ce651f9..07e5e5e67 100644 --- a/test/utils/createBigjsDinero.ts +++ b/test/utils/createBigjsDinero.ts @@ -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'; @@ -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) {