Advertisement
Guest User

fomelo2wiki - pristine calculation

a guest
Sep 12th, 2011
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. if ($positive_or_negative == '+')
  2. {
  3.     if ($value_int <= 10)
  4.         $value_int -= 1;
  5.     else
  6.         $value_int = ceil($value_int / 1.10);
  7. }
  8. else if ($positive_or_negative == '-')
  9. {
  10.     if ($value_int < 0 && $value_int > -11)
  11.         $value_int += 1;
  12.     else
  13.         $value_int = floor($value_int * 1.10);
  14. }
  15. else if ($positive_or_negative == '+-')
  16. {
  17.     if ($value_int <= 10)
  18.         $value_int -= 1;
  19.     else
  20.         $value_int -= (floor($value_int * 1.10) - $value_int);
  21. }
  22.  
  23. return $value_int;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement