OSID Logo
OSID Specifications
locale package
Version 3.0.0
Release Candidate Preview
Interfaceosid.locale.NumericFormattingSession
Implementsosid.OsidSession
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.Typethe target language
CompliancemandatoryThis 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
CompliancemandatoryThis method must be implemented.
MethodcardinalToString
Description

Gets a string representation of a cardinal.

Parameterscardinalca cardinal value
Returnstringthe display string
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcardinalsToStrings
Description

Gets a string representation of an array of cardinals.

Parameterscardinal[]ca cardinal value array
Returnstring[]the display strings
ErrorsNULL_ARGUMENT c is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodstringToCardinal
Description

Parses a cardinal string.

Parametersstringstra cardinal string
Returncardinalthe cardinal value
ErrorsINVALID_ARGUMENT str not of getNumericFormatType()
NULL_ARGUMENT str is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddecimalToString
Description

Gets a string representation of a decimal.

Parametersdecimalda decimal value
Returnstringthe display string
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddecimalsToStrings
Description

Gets a string representation of an array of decimals.

Parametersdecimal[]da decimals value array
Returnstring[]the display strings
ErrorsNULL_ARGUMENT d is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddecimalToString
Description

Parses a decimal string.

Parametersstringstra decimal string
Returndecimalthe decimal value
ErrorsINVALID_ARGUMENT str not of getNumericFormatType()
NULL_ARGUMENT str is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodintegerToString
Description

Gets a string representation of a integer.

Parametersintegerian integer value
Returnstringthe display string
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodintegersToStrings
Description

Gets a string representation of an array of integers.

Parametersinteger[]ian integer value array
Returnstring[]the display strings
ErrorsNULL_ARGUMENT i is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodintegerToString
Description

Parses an integer string.

Parametersstringstran integer string
Returnintegerthe integer value
ErrorsINVALID_ARGUMENT str not of getNumericFormatType()
NULL_ARGUMENT str is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.