Error when trying to increase decimal places

My shopping cart is rounding the decimal places on the discounts, which is costing me about $0.50 per $50. I found this knowedge base: CS-Cart Documentation — CS-Cart 4.15.x documentation, But when I change the line of code from



$price = sprintf('%.' . $decimals . 'f', round((double) $price + 0.00000000001, $decimals));


To:


$price = sprintf('%.' . $decimals . 'f', round((double) $price + 0.00000000001, 4));




I get an error message, and the decimal issue is not fixed. Any help would be great. Thanks