Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 2d76ec5

Browse files
author
Suriyapong
committed
fix(bug): remove comma when decimal point more than three.
1 parent 1c6fc77 commit 2d76ec5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ngx-number-format/lib/ngx-number-format.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export class NgxNumberFormatService {
3333
autoFillDecimal(_value: string, _decimal: number, _format: boolean): string {
3434
_value = Number(this.removeComma(_value)).toFixed(_decimal).toString();
3535
if (_format) _value = this.applyCommaFormat(_value);
36+
if (_decimal > 0) _value = _value.split(".")[0] + '.' + this.removeComma(_value.split(".")[1]);
3637
return _value;
3738
}
3839

0 commit comments

Comments
 (0)