I have a list of prices with a comma for a decimal point and a dot as the thousand separator.
Some examples:
12,30
116,10
1.563,14
These come in this format from a third party. I want to convert them to floats and add them together.
What is the best way to do this? number_format doesn't seem to work with this format, and str_replace seems like overkill, as I have to do it more that once on each number.
Is there are better way? Thanks.
Might look excessive but will convert any given format no mater the locale:
Output: