OSID Logo
OSID Specifications
locale package
Version 3.0.0
Release Candidate Preview
Interfaceosid.locale.CurrencyFormattingSession
Implementsosid.OsidSession
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.Typethe currency type
CompliancemandatoryThis method must be implemented.
MethodgetNumericFormatType
Description

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

Returnosid.type.Typethe numeric format type
CompliancemandatoryThis 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
CompliancemandatoryThis method must be implemented.
MethodcurrencyToString
Description

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

Parametersosid.financials.Currencyamounta currency value
Returnstringthe display string
ErrorsINVALID_ARGUMENT amount.getCurrencyType() != getCurrencyType()
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis 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[]amountsan array of amounts
Returnstring[]the display strings
ErrorsINVALID_ARGUMENT amount.getCurrencyType() != getCurrencyType()
NULL_ARGUMENT amounts is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodstringToCurrency
Description

Parses a currency amount.

Parametersstringsa currency string
Returnosid.financials.Currencythe currency amount
ErrorsINVALID_ARGUMENTs is not of getCurrencyType() or s is not of getNumericFormatType()
NULL_ARGUMENT s is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.