currency Namespace Reference


Detailed Description

Handles the formatting of monetary amounts according to different formatting styles.

An amount can be formatted according to a given style, or to the style for a given ISO 4217 currency code (eg. AUD).

The class can also be used to validate currency amounts according to a particular formatting style, and to convert a formatted string to a double amount.

Example usage:

------------------------------------------------------------------------- $cf = new CurrencyFormatter();

$formattedAmount = $cf->format(1234.56, "ESP"); // $formattedAmount is now == "1.234,56 Ptas"

$formattedAmount = $cf->format(1234.56, "GBP"); // $formattedAmount is now == "£1.234,56"

$decimal = $cf->toDecimal("1.234,56 Ptas"); // $decimal is now == 1234.56;

$isValid = $cf->validate("1.234,56 Ptas", "ESP"); // $isValid is now == true $isValid = $cf->validate("1.234,56", "ESP"); // $isValid is now == true $isValid = $cf->validate("1,234.56 Ptas", "ESP"); // $isValid is now == false

-------------------------------------------------------------------------

Author:
Simon Wade <simonvwade@yahoo.com>
Version:
Id
CurrencyFormatter.inc,v 1.1.1.1 2001/08/13 07:48:35 simonw Exp
public

CopyLeft (L) 2001-2006 - [MIOLO Development Team] SOLIS - Cooperativa de Soluções Livres - Lajeado/RS - Brasil