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()

Returns Currency

The currency for the Price object.

decimal([Number:precision])

Returns 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()

Returns 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()

Returns 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()

Returns 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()

Returns 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()

Returns 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()

Returns Number

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

taxRate()

Returns Number

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

toMoney([Boolean:includingTax])

Returns 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.

toString()

Returns String

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