refactor(05): custom installments
This commit is contained in:
parent
265ea35bc4
commit
2fe37da69f
2 changed files with 127 additions and 69 deletions
|
|
@ -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}` : '');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue