I have a variable which contains a price. This price is rendering as a string. How do I cast this to be a float or Int with 2 decimal places
I have tried the following...
$Gwith = "10";
$cart['total'] = number_format((float)$Gwith, 2, '.', '');
// output should be 10.00 as a 2 place decimal
But this is rendering as a string?
I need this to be an Int as the gateway I am posting to requires it to be a numeric amount.