Posted By

ricosushi on 07/14/10


Tagged

format decimal two digits


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ricosushi


two digits format


 / Published in: PHP
 

Returns 01 from a 1 paramenter value.

  1. // da formato de 00 a los numeros
  2. function formatoZero($n){
  3. if($n < 10){
  4. $nn = "0" . $n;
  5. }else{
  6. $nn = $n;
  7. }
  8.  
  9. return $nn;
  10. }

Report this snippet  

You need to login to post a comment.