Uecko_ERP/modules/customer-invoices/src/api/application/helpers/format-money-dto.ts
2025-09-19 11:29:49 +02:00

17 lines
387 B
TypeScript

import { MoneyDTO } from "@erp/core";
import { MoneyValue } from "@repo/rdx-ddd";
export function formatMoneyDTO(amount: MoneyDTO, locale: string) {
if (amount.value === "") {
return "";
}
const money = MoneyValue.create({
value: Number(amount.value),
currency_code: amount.currency_code,
scale: Number(amount.scale),
}).data;
return money.format(locale);
}