SUPPORT-8724: number to local string formatter
This commit is contained in:
parent
863b1ddfe4
commit
5d7e666e72
1 changed files with 10 additions and 0 deletions
|
|
@ -0,0 +1,10 @@
|
|||
import {TextFormatter} from "@webbpm/base-package";
|
||||
|
||||
export class NumberToLocalStringFormatter implements TextFormatter {
|
||||
public locale: string;
|
||||
|
||||
format(value: string): string {
|
||||
const numberValue = Number(value);
|
||||
return this.locale ? numberValue.toLocaleString(this.locale) : numberValue.toLocaleString();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue