OSID Logo
OSID Specifications
locale package
Version 3.1.0
Interfaceosid.locale.CurrencyFormattingSession
Implementsosid.OsidSession
Used Byosid.locale.LocaleManager
osid.locale.LocaleProxyManager
Description

This session defines methods to format and parse currency amounts.

MethodgetCurrencyType
Description

Gets the currency type for amounts used in this session.

Returnosid.type.Type the currency type
Compliancemandatory This method must be implemented.
MethodgetNumericFormatType
Description

Gets the numeric format type for the amounts used in this session.

Returnosid.type.Type the numeric format type
Compliancemandatory This method must be implemented.
MethodcanFormatCurrencies
Description

Tests if this user can format and parse currencies. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.

Returnboolean false if translation methods are not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodcurrencyToString
Description

Gets a string representation of a currency including the currency symbol indicated by the currency type.

Parametersosid.financials.Currencyamount a currency value
Returnstring the display string
ErrorsINVALID_ARGUMENT amount.getCurrencyType()!= getCurrencyType()
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcurrenciesToStrings
Description

Gets a string representation of a list of currency amounts including the currency symbols indicated by the currency type.

Parametersosid.financials.Currency[]amounts an array of amounts
Returnstring[] the display strings
ErrorsINVALID_ARGUMENT amount.getCurrencyType()!= getCurrencyType()
NULL_ARGUMENT amounts is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodstringToCurrency
Description

Parses a currency amount.

Parametersstrings a currency string
Returnosid.financials.Currency the currency amount
ErrorsINVALID_ARGUMENT s is not of getCurrencyType() or s is not of getNumericFormatType()
NULL_ARGUMENT s is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.