-
-
Save fjaguero/6932045 to your computer and use it in GitHub Desktop.
// Adds the thousands separator | |
function numberWithThousands(x) { | |
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); | |
} |
i think it might be a reactjs problem for not changing the values. Thank you for the help
formatter={(value) => ` ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={(value) => value.replace(/\$\s?|(,*)/g, '')}
I'm using this, with the comma works fine but i want to use a dot as a thousand separator and a comma for decimals.
But if i put a dot instead of a comma i get this result 2.0.0.0.0.000 can someone help me?
formatter={(value) => ` ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')} parser={(value) => value.replace(/\$\s?|(,*)/g, '')}
I'm using this, with the comma works fine but i want to use a dot as a thousand separator and a comma for decimals. But if i put a dot instead of a comma i get this result 2.0.0.0.0.000 can someone help me?
@OmarNassar01 Hi, did you find solution?
Then pass toLocaleString('en-GB')