I'm using php's NumberFormatter library to work with conversion, but I'm having a problem converting numbers with many digits after the.
Example:
$valores = '54.98054562';
$moeda1 = new NumberFormatter('pt_BR', NumberFormatter::DECIMAL);
$moeda1->setAttribute( NumberFormatter::MIN_FRACTION_DIGITS, 2);
$valores = $moeda1->formatCurrency($valores, 'BRL');
echo $valores;
It returns me 54,981 and needs to return 54.98.
Does anyone know how to solve this?