rarebit Posted June 18, 2008 Share Posted June 18, 2008 I'm wanting to round up to the nearest pence... ceil works with ints not floats, so i'm adding half a unit, which eventually didn't work, so i'm now using just under half a unit, e.g. $a1 = round(($cost2+0.0049),2); any other way... merci... Quote Link to comment Share on other sites More sharing options...
Jabop Posted June 18, 2008 Share Posted June 18, 2008 What is wrong with round? Quote Link to comment Share on other sites More sharing options...
rarebit Posted June 18, 2008 Author Share Posted June 18, 2008 if it was 1.49, then it would round down, not up, same for 1.01... I used to add 0.5, but if it is 1.0 then php round does that up also, if I remember correctly certain other languages wouldn't in that instance (i'm not mentioning a language 'cos i'm partial to my head!) Quote Link to comment Share on other sites More sharing options...
rarebit Posted June 18, 2008 Author Share Posted June 18, 2008 I'll class this as so.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.