Rounding off Fee
-
Hi,
Thanks for the plugin… works really well for me. I need a small info. When the user inputs the address, the plugin does calculate the fee well. I just want to roundn off the fee to the nearest integer so the user sees a rounded off price. Eg when the price calculated is 170.12, I want to display 170. Is there a way to do this ? I did try the adding filter method in the functions.php. Am I doing something wrong ?add_filter( ‘dbf_calculated_fee’, ‘my_dbf_calculated_fee_callback’, 1, 15 );
function my_dbf_calculated_fee_callback( $calculatedFee, $kiloMeters, $divider, $price ) {
return round($calculatedFee);
}The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Rounding off Fee’ is closed to new replies.