So I have this little problem.
I have a form where you can enter a number, it can be in European format, with comma as decimal (,), or American with the decimal point (.).

Knowing this, how can I convert the number format from the European American format? And the American format leave it unchanged?

I tried using this formula but the result is wrong.

```
$american = '12.5';
$european = '12,5';

$locale = 'it_IT.utf8';
setlocale ('LC_NUMERIC', $locale);
$fmt = new NumberFormatter ($locale, NumberFormatter::DECIMAL);
$american = $ fmt->parse($american);
$european = $ fmt->parse($europen);

response

$american = 125
$european = 12.5

```

Where is the problem?

php ver. 5.4.10