Cita:
Iniciado por ioko
Alguien mas que pueda ayudar? He leido bastante sobre esto, pero como no tengo tanta experiencia no estoy sabiendo donde anidar la funcion. Saludos y gracias
El enlace que te da Chimera esta bien me dirigi a esa pagina y encontre esto, hay tu lo implementas a tu criterio :).
Código PHP:
<?php
// the comments show the output generated by this script
echo "input 8.525 output = ". number_format( 8.525, 2, '.', "") ."\n";
echo "input 8.525 output = ". number_format(8.525, 2, '.', "") ."\n";
// input 8.525 output = 8.53
// input 8.525 output = 8.53
$a = 483.00;
$b = 0.175;
$c = $a * $b;
echo "input \$c = $c type ". gettype($c) ." output = ". number_format( $c, 2, '.', "") ."\n";
// input $c = 84.525 type double output = 84.52
$d = 17.5;
$e = ( $a / 100 ) * $d;
echo "input \$e = $e type ". gettype($e) ." output = ". number_format( $e, 2, '.', "") ."\n";
// input $e = 84.525 type double output = 84.53
echo "input 63.745 output = ". number_format(63.745, 2, '.', "") ."\n";
echo "input 64.745 output = ". number_format(64.745, 2, '.', "") ."\n";
echo "input 65.745 output = ". number_format(65.745, 2, '.', "") ."\n";
// input 63.745 output = 63.74
// input 64.745 output = 64.75
// input 65.745 output = 65.75
?>