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

This session defines methods to format and parse numbers.

MethodgetNumericFormatType
Description

Gets the numeric format type used in this session. The numeric format type indicates the format of a number used in a culture, such as the use of a period for a decimal place.

Returnosid.type.Type the target language
Compliancemandatory This method must be implemented.
MethodcanFormatNumbers
Description

Tests if this user can format and parse numbers. 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.
MethodcardinalToString
Description

Gets a string representation of a cardinal.

Parameterscardinalc a cardinal value
Returnstring the display string
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcardinalsToStrings
Description

Gets a string representation of an array of cardinals.

Parameterscardinal[]c a cardinal value array
Returnstring[] the display strings
ErrorsNULL_ARGUMENT c is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodstringToCardinal
Description

Parses a cardinal string.

Parametersstringstr a cardinal string
Returncardinal the cardinal value
ErrorsINVALID_ARGUMENT str not of getNumericFormatType()
NULL_ARGUMENT str is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddecimalToString
Description

Gets a string representation of a decimal.

Parametersdecimald a decimal value
Returnstring the display string
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddecimalsToStrings
Description

Gets a string representation of an array of decimals.

Parametersdecimal[]d a decimals value array
Returnstring[] the display strings
ErrorsNULL_ARGUMENT d is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethoddecimalToString
Description

Parses a decimal string.

Parametersstringstr a decimal string
Returndecimal the decimal value
ErrorsINVALID_ARGUMENT str not of getNumericFormatType()
NULL_ARGUMENT str is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodintegerToString
Description

Gets a string representation of an integer.

Parametersintegeri an integer value
Returnstring the display string
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodintegersToStrings
Description

Gets a string representation of an array of integers.

Parametersinteger[]i an integer value array
Returnstring[] the display strings
ErrorsNULL_ARGUMENT i is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodintegerToString
Description

Parses an integer string.

Parametersstringstr an integer string
Returninteger the integer value
ErrorsINVALID_ARGUMENT str not of getNumericFormatType()
NULL_ARGUMENT str is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.