Jump to content

Nearest Quarter


ecabrera

Recommended Posts

I want to get my price to the nearest quarter for example if its 563 it will go to 550. I don't know what the next step should be. All my prices are whole numbers not decimals.

$sql = "SELECT AVG(pay) from `data` WHERE `o_state`='$o_state' and `d_state`='$d_state' and `first` LIKE '$firstdate%'";
$run = mysqli_query($db,$sql);

$rows = mysqli_fetch_assoc($run);

echo $mean = $rows['AVG(pay)'];
$mean = round($mean, 0);

Link to comment
https://forums.phpfreaks.com/topic/295988-nearest-quarter/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.