ZenMagick 0.9.8


org.zenmagick.store.model.ZMCurrency
\store\model\locale\ZMCurrency.php at line 34

Class ZMCurrency

ZMObject
└─ZMCurrency

public class ZMCurrency
extends ZMObject

A single currency.

Author:
DerManoMann
Version:
$Id: ZMCurrency.php 2694 2009-12-03 22:32:18Z dermanomann $

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMCurrency()

Create new instance.

Method Summary
float

convertFrom(float amount)

Convert from this currency into default currency.

float

convertTo(float amount)

Convert from default currency into this currency.

string

format(float amount, boolean convert)

Format the given amount according to this currency's rate and formatting rules.

string

getCode()

Get the currency code.

int

getDecimalPlaces()

Get the currency decimal places.

string

getDecimalPoint()

Get the currency decimal point.

int

getId()

Get the currency id.

string

getName()

Get the currency name.

double

getRate()

Get the currency rate.

string

getSymbolLeft()

Get the currency symbox (left).

string

getSymbolRight()

Get the currency symbox (right).

string

getThousandsPoint()

Get the currency thousands point.

float

parse(string value)

Parse a formatted currency amount.

void

setCode(string code)

Set the currency code.

void

setDecimalPlaces(int decimals)

Set the currency decimal places.

void

setDecimalPoint(string point)

Set the currency decimal point.

void

setId(int id)

Set the currency id.

void

setName(string name)

Set the currency name.

void

setRate(double rate)

Set the currency rate.

void

setSymbolLeft(string symbol)

Set the currency symbox (left).

void

setSymbolRight(string symbol)

Set the currency symbox (right).

void

setThousandsPoint(string point)

Set the currency thousands point.

Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

\store\model\locale\ZMCurrency.php at line 48

ZMCurrency

public ZMCurrency()

Create new instance.


Method Detail

\store\model\locale\ZMCurrency.php at line 227

convertFrom

public float convertFrom(float amount)

Convert from this currency into default currency.

Parameters:
amount - The amount in this currency.
Returns:
The converted amount.

\store\model\locale\ZMCurrency.php at line 217

convertTo

public float convertTo(float amount)

Convert from default currency into this currency.

Parameters:
amount - The amount in the default currency.
Returns:
The converted amount.

\store\model\locale\ZMCurrency.php at line 205

format

public string format(float amount, boolean convert)

Format the given amount according to this currency's rate and formatting rules.

Parameters:
amount - The amount.
convert - If true, consider $amount to be in default currency and convert before formatting.
Returns:
The formatted amount.

\store\model\locale\ZMCurrency.php at line 79

getCode

public string getCode()

Get the currency code.

Returns:
The currency code.

\store\model\locale\ZMCurrency.php at line 121

getDecimalPlaces

public int getDecimalPlaces()

Get the currency decimal places.

Returns:
The currency decimal places.

\store\model\locale\ZMCurrency.php at line 107

getDecimalPoint

public string getDecimalPoint()

Get the currency decimal point.

Returns:
The currency decimal point.

\store\model\locale\ZMCurrency.php at line 72

getId

public int getId()

Get the currency id.

Returns:
The currency id.

\store\model\locale\ZMCurrency.php at line 86

getName

public string getName()

Get the currency name.

Returns:
The currency name.

\store\model\locale\ZMCurrency.php at line 130

getRate

public double getRate()

Get the currency rate.

This is the rate in relation to the default currency.

Returns:
The currency rate.

\store\model\locale\ZMCurrency.php at line 93

getSymbolLeft

public string getSymbolLeft()

Get the currency symbox (left).

Returns:
The currency symbol (left).

\store\model\locale\ZMCurrency.php at line 100

getSymbolRight

public string getSymbolRight()

Get the currency symbox (right).

Returns:
The currency symbol (right).

\store\model\locale\ZMCurrency.php at line 114

getThousandsPoint

public string getThousandsPoint()

Get the currency thousands point.

Returns:
The currency thousands point.

\store\model\locale\ZMCurrency.php at line 237

parse

public float parse(string value)

Parse a formatted currency amount.

Parameters:
value - The formatted currency value.
Returns:
The amount.

\store\model\locale\ZMCurrency.php at line 144

setCode

public void setCode(string code)

Set the currency code.

Parameters:
code - The currency code.

\store\model\locale\ZMCurrency.php at line 186

setDecimalPlaces

public void setDecimalPlaces(int decimals)

Set the currency decimal places.

Parameters:
decimals - The currency decimal places.

\store\model\locale\ZMCurrency.php at line 172

setDecimalPoint

public void setDecimalPoint(string point)

Set the currency decimal point.

Parameters:
point - The currency decimal point.

\store\model\locale\ZMCurrency.php at line 137

setId

public void setId(int id)

Set the currency id.

Parameters:
id - The currency id.

\store\model\locale\ZMCurrency.php at line 151

setName

public void setName(string name)

Set the currency name.

Parameters:
name - The currency name.

\store\model\locale\ZMCurrency.php at line 195

setRate

public void setRate(double rate)

Set the currency rate.

This is the rate in relation to the default currency.

Parameters:
rate - The currency rate.

\store\model\locale\ZMCurrency.php at line 158

setSymbolLeft

public void setSymbolLeft(string symbol)

Set the currency symbox (left).

Parameters:
symbol - The currency symbol (left).

\store\model\locale\ZMCurrency.php at line 165

setSymbolRight

public void setSymbolRight(string symbol)

Set the currency symbox (right).

Parameters:
symbol - The currency symbol (right).

\store\model\locale\ZMCurrency.php at line 179

setThousandsPoint

public void setThousandsPoint(string point)

Set the currency thousands point.

Parameters:
point - The currency thousands point.

ZenMagick 0.9.8