i have number for which i have to apply a thousand separator
ex if my number
double num = 123454545.125871656
the result should be like
123,454,545.125871656
What I have tried:
num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
the result getting correct if have pure integer value like 12345789
12,345,789
but when i get double value like 123454545.125871656
i am getting 123,454,545.125,871,656 ---->this worng