The following gists shows a few approaches for working with Drupal commerce order totals.
All three examples retrieve the order total as two components Ex Vat and VAT:
The first example shows how to get nicely formatted amounts. This is easily done using two functions: commerce_price_component_total() - Returns the total value and currency for the specified price component in a price array. commerce_currency_format() - formats the amount with the correct localization and currency symbol
However if you don't need the currency symbol things get a bit harder.
The following gist takes a simplistic approach and replaces commerce_currency_format() with commerce_currency_amount_to_decimal()
This works however it has two potential issues
1) The formatted amount does not include localized number formatting (decimal & thousands separators)
2) The number will not have any localized rounding (many countries round to the nearest 5c or 10 cent as those are the smallest coins they support)
The third version solves this using the following functions: commerce_currency_load() - Returns a currency array holding data about the currency format commerce_currency_round() - this solves the rounding issue number_format() - The PHP number formatting function that uses the currency array to get the number of decimal places and the decimal & thousands separator we retrieved using commerce_currency_load()
Finally be aware that you have other low level functions that can be used to look at the total in other ways.
for example if you wanted to get the total of an order excluding delivery you can use the commerce_line_items_total() function that takes a line item type and can be used in the following way