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 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. 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
Archived
This topic is now archived and is closed to further replies.