You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to display the value with comma as decimal separator and dot as thousand separator? Something like:
$decimal->toFixed(2, ',', '.');
or
$decimal->format(2, ',', '.'); // similarly to number_format
Thanks.
The text was updated successfully, but these errors were encountered:
cawecoy
changed the title
Using comma as decimal separator and dot as thousand separator
Display the value with comma as decimal separator and dot as thousand separator
Jul 1, 2020
cawecoy
changed the title
Display the value with comma as decimal separator and dot as thousand separator
How to display the value with comma as decimal separator and dot as thousand separator?
Jul 1, 2020
Unfortunately that is not supported right now, but you raise a good point in that there no equivalent for number_format. Your best option would be to do a string replace on the result of toFixed. I think a generic format method would be good, as suggested. Perhaps:
function format(int$decimalPlaces, string$decimalPoint = '.', string$thousandsSep = ',')
Hi.
Is there a way to display the value with comma as decimal separator and dot as thousand separator? Something like:
or
Thanks.
The text was updated successfully, but these errors were encountered: