I'm wondering if there is J-API way to parse and format numbers (like JDate).
When you convert decimal numbers into different locales, the user can enter numbers in this way "1.234.567,891" and Joomla must save it to SQL as "1234567.891" and finally the number must be shown back as "1.234.567,891". Of course, most users only enter "1234567,891", and the conversion to SQL must work similarly.
Something like numfmt_parse and numfmt_format.
$fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL );
$num = "1.234.567,891";
echo numfmt_parse($fmt, $num)."\n";
echo numfmt_parse($fmt, $num, NumberFormatter::TYPE_INT32)."\n";
Is there any better way to convert floats according to the user locale?