jkkenzie Posted September 3, 2009 Share Posted September 3, 2009 Hi! I would like to divide a number by 20000 and truncate the decimal values . e.g i have 234.999990099 i want it to read as 234 Quote Link to comment https://forums.phpfreaks.com/topic/172997-solved-get-rid-of-the-decimal-values/ Share on other sites More sharing options...
Daniel0 Posted September 3, 2009 Share Posted September 3, 2009 Cast it as int or use any of round, ceil or floor depending on your needs. The difference between casting to int (truncating) and flooring is that flooring rounds towards negative infinity and truncating rounds towards 0. Quote Link to comment https://forums.phpfreaks.com/topic/172997-solved-get-rid-of-the-decimal-values/#findComment-911779 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.