DEV Community

Mohammed Samgan Khan
Mohammed Samgan Khan

Posted on • Updated on • Originally published at dev.to

function to round up a float number to next point five like 3.3 to 3.5, 3.8 to 4

If you are from the shipping industry you face this problem a lot of time where you charge per 0.5 kg. In this kind of case, you need to make the weight from float to round up.

here is a php function to achieve that.

Top comments (0)