refactor(utils): always append currency .00

This commit is contained in:
Methapon Metanipat 2024-10-21 15:05:40 +07:00
parent 65bb13837e
commit 3b3979e403

View file

@ -440,7 +440,7 @@ export function commaInput(text: string): string {
const parts = num.toString().split('.');
const integerPart = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
const decimalPart = parts[1]?.slice(0, 2) || '';
const decimalPart = parts[1]?.slice(0, 2) || '00';
return integerPart + (decimalPart ? `.${decimalPart}` : '');
}