Skip to content

Commit

Permalink
FiatStore: update numberWithCommas
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed Jul 9, 2024
1 parent df6b345 commit aba79c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stores/FiatStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class FiatStore {
@observable public error = false;

@observable public numberWithCommas = (x: string | number) =>
x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
x?.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g, ',') || '0';

@observable public numberWithDecimals = (x: string | number) =>
this.numberWithCommas(x).replace(/[,.]/g, (y: string) =>
Expand Down

0 comments on commit aba79c9

Please sign in to comment.