Advertisement
dave_kamenenko

Untitled

Jun 13th, 2021
860
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.25 KB | None | 0 0
  1. <?php
  2. function nFormat($int) {
  3.  
  4.     if ($int > 1000 && $int < 1000000) $int = round(number_format($int, 0, "", "."), 1)."k";
  5.     elseif ($int >= 1000000) $int = round(number_format($int, 0, "", "."), 1)."m";
  6.  
  7.  
  8.     return $int;
  9.  
  10.   }
  11.  
  12. ?>
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement