I am making a query, which gets 2 values from the database. It returns the correction values with commas. But when multiplying is done, it is not counting the decimal places.
foreach ($compra['CompraItem'] as $valores) {
$cotacao = $modeloMoedaCotacao->find('first', array('conditions'=>array(
'MoedaCotacao.moeda_id' => $valores['moeda_id'],
'MoedaCotacao.data' => date("Y-m-d"),
), array(
'limit' => 1,
)));
echo $cotacao = FloatFromSQL($cotacao['MoedaCotacao']['cotacao']);
echo '<br />';
echo $valor = FloatFromSQL($valores['valor']);
echo '<br />';
$valorTotal = $valor * $cotacao;
echo $valorTotal;
echo '<br />';
}
Return:
5.14000 1980.00 = multiplication returns without using the decimal > > 9900
3.23000 160.00 = multiplication returns without using the decimal> > 480
5.14000 70.00 = multiplication returns without using the decimal> > 350