commit compras 2711
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-27 13:49:31 +02:00
parent dc73540558
commit e709d900d1
81 changed files with 5352 additions and 107 deletions
+10
View File
@@ -0,0 +1,10 @@
export const estimateMoney = (value: number | null) => {
if (value === null) return '';
const digits = String(value).padStart(3, '0');
return `${digits.slice(0, -2)}.${digits.slice(-2)}`;
};
export const estimateMinor = (value: string): number | string => {
if (!/^\d{1,13}(?:[.,]\d{1,2})?$/.test(value)) return value;
const [whole, fraction = ''] = value.replace(',', '.').split('.');
return Number(BigInt(whole) * 100n + BigInt(fraction.padEnd(2, '0')));
};