Price

Extends Object. Unlike the Money object, Price is tax aware so it can be used to retrieve either an inclusive or exclusive of Tax value, but defaults output to the session's tax rule. 

Methods
currency() Currency

The currency for the Price object.

decimal([Number:precision]) String

A decimal representation of the Price as a string, which maintains decimal places. The precision of decimal places will use that of the currency settings if not provided.

excludingTax() Money

Returns a Money object of the price excluding sales tax. The Money object returned is not aware of Tax, just a total value.

format() String

The format method returns a String representation of the price either inclusive or exclusive of tax based on the session's current tax rule.

includingTax() Money

Returns a Money object of the price including sales tax. The Money object returned is not aware of Tax, just a total value.

suffix() String

Returns a String to be shown after the price to indicate tax information e.g. +VAT. The suffix is aware of whether prices are to be shown inclusive or exclusive of tax and will show the appropriate label.

tax() Money

Returns a Money object representing the sales tax on the price. Tax is based on the current tax rule for the session, the price's tax rule and the current locale.

taxPercentage() Number

Returns the tax rate as a percentage charged on the product, based on the product's tax classifier/calculator.

taxRate() Number

Returns the tax rate as a decimal value charged on the product, based on the product's tax classifier/calculator.

toMoney([Boolean:includingTax]) Money

Returns a Money object representing either the price including or excluding tax. By default the method automatically selects the tax rule from the current session.

toNumber() Number

Returns the price value as a number.

toString() String

Returns a String based on the price.format() method.