If you wan’t to round off decimal value to nearest heights value you can use bellow code
<?php if( !function_exists('ceiling') ) { function ceiling($number, $significance = 1) { $value = ( is_numeric($number) && is_numeric($significance) ) ? (ceil($number/$significance)*$significance) : false; if(!isFloatWith2Decimals($value)){ return $value.'0'; }else{ return $value; } } } function isFloatWith2Decimals($number) { return (bool) preg_match('/^(?:[1-9]{1}\d*|0)\.\d{2}$/', $number); }
Output of above code
Input value 44.61
Output: 44.65
Input value 44.68
Output: 44.70
Hope this will help you 🙂