Advertisement
Bruno

[PHP] Função de arredondar números

Apr 24th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.23 KB | None | 0 0
  1. /*arredondar números. arredonda para duas casas decimais o valor, exemplo:
  2. 15.594198498 iria ficar só 15.59, se fosse 15.5969 arredondaria para 15.60 */
  3.  
  4. function arredondar ( $num ) {
  5.         return round ( $num * 100 ) / 100;
  6.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement