Função para formatar moeda


/ Published in: PHP
Save to your folder(s)

tipo banco = formato para inserir no banco


Copy this code and paste it in your HTML
  1. function FormatNumber($valor,$tipo){
  2. if($tipo=="banco"){$number=number_format($valor,2,'.',',');}
  3. else{$number=number_format($valor,2,',','.');}
  4. return $number;
  5. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.