Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
Thank you Nathan, This worked quite well. --Rick On Jan 22, 2010, at 8:10 PM, Nathan Rixham wrote: Rick Dwyer wrote: On Jan 22, 2010, at 7:30 PM, Nathan Rixham wrote: Thanks Nathan I'll give it a shot. np - here's a more condensed version: function round_to_half_cent( $value ) { $

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Nathan Rixham
Rick Dwyer wrote: > On Jan 22, 2010, at 7:30 PM, Nathan Rixham wrote: > Thanks Nathan I'll give it a shot. > np - here's a more condensed version: function round_to_half_cent( $value ) { $value = ($value*100) + 0.3; $out = number_format( floor($value)/100 , 2 ); return $o

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
On Jan 22, 2010, at 7:30 PM, Nathan Rixham wrote: Thanks Nathan I'll give it a shot. --Rick your doing the number format before the rounding.. here's a version of the function that should fit the bill: function round_to_half_cent( $value ) { $value *= 100; if( $value ==

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Nathan Rixham
Rick Dwyer wrote: > > On Jan 22, 2010, at 4:24 PM, tedd wrote: > >>> Hello List. >>> >>> In an earlier post, I received help with a custom function to round >>> decimals off (the custom function provided by Adam Richardson is below). >>> >>> However in my MySQL db, when I have values with only 1

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
On Jan 22, 2010, at 4:24 PM, tedd wrote: Hello List. In an earlier post, I received help with a custom function to round decimals off (the custom function provided by Adam Richardson is below). However in my MySQL db, when I have values with only 1 decimal point, I need the value PHP r

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread tedd
Hello List. In an earlier post, I received help with a custom function to round decimals off (the custom function provided by Adam Richardson is below). However in my MySQL db, when I have values with only 1 decimal point, I need the value PHP returns to display as 2. For example, 3.8 need

Re: [PHP] Formatting Decimals Further Help

2010-01-22 Thread Rick Dwyer
Hello List. In an earlier post, I received help with a custom function to round decimals off (the custom function provided by Adam Richardson is below). However in my MySQL db, when I have values with only 1 decimal point, I need the value PHP returns to display as 2. For example, 3.8 need