SHARE
TWEET

Function Bulatkan Angka (Statis) Dari Belakang

GarryLaly Mar 14th, 2014 158 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function bulatkan_angka($num) {
  2.         $b = 3-strlen(round($num));
  3.         return round(substr_replace(round($num), '.', -3, 0)).str_repeat('0',strpos($num.'.','.')+$b);
  4. }
  5. echo bulatkan_angka(-3156864.6); //Output: -3157000
RAW Paste Data
Top