refactor(05): custom installments

This commit is contained in:
puriphatt 2024-10-15 16:56:07 +07:00
parent 265ea35bc4
commit 2fe37da69f
2 changed files with 127 additions and 69 deletions

View file

@ -439,7 +439,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] || '';
const decimalPart = parts[1]?.slice(0, 2) || '';
return integerPart + (decimalPart ? `.${decimalPart}` : '');
}