Formatear Número en PHP
Por MigueliTUX Aug.07, 2009, categoría Php
para formatear números en PHP, aquí les dejo esta rutina.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | /* |-------------------------------------------------------------- | Formatea Numeros | Parametros | numero : Numero a formatear | Retorno | Numero Formateado |-------------------------------------------------------------- */ function _formatea_numero($numero){ if (is_numeric($numero)) { $find = array('.', ',','$'); $numero = str_replace ($find, "", $numero); $numero=number_format($numero,0,",","."); } return $numero; } |
March 20th, 2010 on 1:53 pm
[...] Nú en PHP http://www.tips.cl/archives/446 #TipsCL [...]
April 24th, 2010 on 1:47 pm
[...] Nú en PHP http://www.tips.cl/archives/446 #TipsCL [...]
May 29th, 2010 on 1:54 pm
[...] Nú en PHP http://www.tips.cl/archives/446 #TipsCL [...]
June 12th, 2010 on 1:57 pm
[...] Nú en PHP http://www.tips.cl/archives/446 #TipsCL [...]