Pode ser aqui o problema também: <? //echo $_SESSION['carrinho'][$key]['qtde']; echo '<input type=text" maxlength="10" size="2" name="'.$key.'" id="'.$key.'" value="'.$_SESSION['carrinho][$key]['qtde'].'" class=inpqtde" />'; ?> <input type="text" maxlength="10" class="inpqtde" name="prec_<?=$key?>" id="prec_<?=$key?>" style="width:50px;" value="<?=Moeda2(toDouble($_SESSION['carrinho][$key]['price']))?>"/> </td> <td width=114" style="width: 90px;"> <strong> <? $currentQuantity = (int) $_SESSION['carrinho][$key]['qtde']; $currentUnitPrice = $_SESSION['carrinho'][$key]['price']; $total += $currentQuantity * toDouble($currentUnitPrice); echo Moeda($currentQuantity * toDouble($currentUnitPrice), 2, ',', '.'); ?> // Pois lembrando o problema é quando escolhe-se o produto por exemplo 1 detergente de 200,23 depois de adicionado ao carrinho ele aparece no valor de 20.023,00 Achei as funçoes que agora com elas acredito que os mais experiente possam me ajudar seguindo o código em vermelho acima, obrigado: function Moeda($value) { return 'R$ ' . Moeda2($value); } function Moeda2($value) { return number_format($value, 2, ',', '.'); } function toDouble($value) { if (gettype($value) == 'string') { $value = str_replace('.', '', $value); $value = str_replace(',', '.', $value); return (double) $value; } return (double) $value; } Responder Citar Tópico mais recente Tópico mais