I have one variable ($TotalCountyTaxAmount) I want to divide by 365 to calculate a daily tax rate. In this example the variable value is 1614.21. When I divide the variable by the number of days (e.g. $TCA / $days), I get 0.2261 which is incorrect. The correct answer should be 4.42. When I change the order (e.g. $days / $TCA) I get a result of 365.
//calculate daily tax rate
$days = '365';
$TCA = str_replace("$", "", $TotalCountyTaxAmount); //strip dollar sign
echo ($days / $TCA);
echo ($TCA / $days);
TIA
I have tried using the number_format() which didn't work. I am limited to the functions available here