I want to get the formatted total amount of my cart items.
I used the following code
$order = commerce_cart_order_load($user->uid);
$wrapper = entity_metadata_wrapper('commerce_order', $order);
$line_items = $wrapper->commerce_line_items;
$total = commerce_line_items_total($line_items);
It returns me $4000
instead of $40.00
.
On shoping cart page it display $40.00
. How can I get the price in this format?
I want this in commerce way not some custom php like number_format
etc.