import Decimal from 'decimal.js';
export const MoneyDecimal = Decimal.clone({ precision: 36, rounding: Decimal.ROUND_HALF_UP });
export function roundedProduct(a: string | number, b: string | number): string { return new MoneyDecimal(a).times(b).toFixed(2); }
export function sumMoney(values: Array<string | number>): string { return values.reduce((sum, value) => sum.plus(value), new MoneyDecimal(0)).toFixed(2); }
export function percentageMoney(base: string | number, percent: string | number): string { return new MoneyDecimal(base).times(percent).dividedBy(100).toFixed(2); }
