pengu Posted July 23, 2009 Share Posted July 23, 2009 Hey guys, My friends and I have a project going on currently and one of our mates has designed a system up for leveling up, items and such. (oh it's a game project) The way hes done it is with percent (which annoys me, but it's possible I'm sure), 1 being 100% 0.2 being 20% ect. Now all values are stored in a database, we have a lot of calculations going on, so I want to make sure before the table is updated all values are 2 decimal points I think e.g 0.20 or 0.02 <- never go past those 2 digits. Now I've seen float() used for this I believe? Do all math kind of things have to be functions? Cheers, Pengu. Quote Link to comment https://forums.phpfreaks.com/topic/167058-solved-decimal-point-questions/ Share on other sites More sharing options...
Third_Degree Posted July 23, 2009 Share Posted July 23, 2009 round() Quote Link to comment https://forums.phpfreaks.com/topic/167058-solved-decimal-point-questions/#findComment-880917 Share on other sites More sharing options...
pengu Posted July 24, 2009 Author Share Posted July 24, 2009 round() Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/167058-solved-decimal-point-questions/#findComment-881655 Share on other sites More sharing options...
Third_Degree Posted July 24, 2009 Share Posted July 24, 2009 No problem. Quote Link to comment https://forums.phpfreaks.com/topic/167058-solved-decimal-point-questions/#findComment-881707 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.