in reply to Re: Round up 3 values to the next 100
in thread Round up 3 values to the next 100

Thanks - I'm using this in my code!
  • Comment on Re^2: Round up 3 values to the next 100

Replies are listed 'Best First'.
Re^3: Round up 3 values to the next 100
by Anonymous Monk on Nov 05, 2011 at 23:02 UTC

    Hi, how about this one?
    This is much more flexible by changing the value of $digit and simple in a one line.

    function roundup($number, $digit = 100) { return ( is_numeric($number) && is_numeric($ digit) ) ? (ceil($numbe +r/$ digit)*$digit) : false; }

    Please feel free to contact me at chae@azstrada.com if you have any questions.
    Chae from Seoul Korea.

      What language are you using? Does not seem to be Perl...