I am trying to simulate a decimal place with Commas to get something like this 1,234,567.90 in turn, I get a white screen.
The code I Use is looking like this
Balance </font></td>
<td width="24%" align="left" rowspan="2">
<font face="Arial Black" size="2"> {numberWithCommas(accDetails.bal.toFixed(2))} Currency = {accDetails.ccy}</font><p />
<font face="Arial Black" size="2"> </font>
</td>
And the function I use looks like this:
const numberWithCommas = (x) => {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
This returns a white screen, I don't even get to see the Error but the Error comes trying to format decimal places for Money in react JS. I need help here.