[PHP-DB] Rounding up results

2010-03-09 Thread Ron Piggott
Is there a way to round up in mySQL? This result may give 3.2 --- so I want the result to be 4? SELECT ( count(`reference`) / $items_per_page ) AS total_pages FROM `store_product_profile` WHERE `store_category_reference` =$reference AND `live` =1 -- PHP Database Mailing List (http://www.php.n

Re: [PHP-DB] Rounding

2004-04-07 Thread Ng Hwee Hwee
PROTECTED]> Sent: Thursday, April 08, 2004 10:06 AM Subject: Re: [PHP-DB] Rounding > > 6.11 --> 6.2 > > 6.15 --> 6.2 > > 6.19 --> 6.2 > > 6.20 --> 6.2 > > > > i know there is a ceil() function but that rounds up to the nearest > > integer..

Re: [PHP-DB] Rounding

2004-04-07 Thread Jason Wong
On Thursday 08 April 2004 09:56, Ng Hwee Hwee wrote: > is there a way to do rounding up to the nearest tenth? can't use ROUND() > cos i need something like this: > > 6.11 --> 6.2 > 6.15 --> 6.2 > 6.19 --> 6.2 > 6.20 --> 6.2 > > i know there is a ceil() function but that rounds up to the nearest >

Re: [PHP-DB] Rounding

2004-04-07 Thread Larry E . Ullman
6.11 --> 6.2 6.15 --> 6.2 6.19 --> 6.2 6.20 --> 6.2 i know there is a ceil() function but that rounds up to the nearest integer.. i need one decimal place still.. If my math is right, you could multiply the number by ten, take the CEILING(), then divide that by 10. Larry -- PHP Database Mailing

[PHP-DB] Rounding

2004-04-07 Thread Ng Hwee Hwee
Hi all, is there a way to do rounding up to the nearest tenth? can't use ROUND() cos i need something like this: 6.11 --> 6.2 6.15 --> 6.2 6.19 --> 6.2 6.20 --> 6.2 i know there is a ceil() function but that rounds up to the nearest integer.. i need one decimal place still.. I tried adding a

[PHP-DB] Rounding numbers again.

2002-03-01 Thread Jennifer Downey
Thanks for answering my question I understand rounding now. My next question is why the script will work like this: $bank_points= $ret; $interest = .095; $months = 12; $weeks = 52; $days=365; $query="SELECT bank_points FROM wt_users WHERE uid={$session["uid"]}"; $ret = mysql_query($query); wh

[PHP-DB] Rounding numbers

2002-03-01 Thread Jennifer Downey
Hi again, Would someone show me how to round numbers: $bank_points= $ret; $interest = .095; $months = 12; $weeks = 52; $days=365; $query="SELECT bank_points FROM wt_users WHERE uid={$session["uid"]}"; $ret = mysql_query($query); while(list($bank_points)= mysql_fetch_row($ret)) $yearly_intere