Welcome Guest, Not a member yet? Register   Sign In
Cart Class Price Format

Hello, I have a question, I've been using the Cart class and it works great however I was wondering what can I do, so for even numbers when the total is calculated, it doesn't take the two zeros for the decimal points off

So if I have
$data = array(
'id' => 'sku_123ABC',
'qty' => 1,
'price' => 39.00,
'name' => 'T-Shirt'
'id' => 'sku_567ZYX',
'qty' => 1,
'price' => 9.00,
'name' => 'Coffee Mug'

Shows 48.00 instead of 48



should work

I thought they were trying to remove the decimal, not add it.
if cart->total() was 1234.56:
$total = (int)$this->cart->total();  //cast as int.   becomes 1234
$total = number_format($this->cart_total); //produces 1,234 with no decimal, but adds thousands separator

@Matalina, Thanks for your help.
@CroNiX I don't think they would remove it since some merchants API's require the no cents decimals in the items price.

Quote:Shows 48.00 instead of 48
I thought you wanted it to show 48 with no decimal.

Theme © iAndrew 2016 - Forum software by © MyBB