View Single Post
Old Aug 10th, 2004, 11:16 PM   #5
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
Another way to do this, though less efficient.

(pseudo coded of course)
$an_integer= (int) $your_num / 300;
$new_val = $an_integer * 300; //this floors to nearest 300
if(( $your_num - $new_val ) >= 150 ) $new_val += 300;
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote