Posted By

alyssonweb on 12/14/10


Tagged

smart percentage


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

qubestream


Smart Percentage


 / Published in: PHP
 

  1. function smartPerc($num)
  2. {
  3. return (( $num - ( int ) $num ) > 0.0) ? number_format( $num, 2, '.', '' ) : (int) $num;
  4. }

Report this snippet  

You need to login to post a comment.