interface XNumberFormatter in module com::sun::star::util::

(Global Index)

Syntax

interface XNumberFormatter : com::sun::star::uno::XInterface ;

Description

represents a number formatter.

Method Summary

attachNumberFormatsSupplier attaches an XNumberFormatsSupplier to this NumberFormatter .

getNumberFormatsSupplier

detectNumberFormat detects the number format in a string which contains a formatted number.

convertStringToNumber converts a string which contains a formatted number into a number.

convertNumberToString converts a number into a string.

queryColorForNumber

formatString converts a string into another string.

queryColorForString

getInputString converts a number into a string with the specified format.

Known Services Which Export this Interface

com::sun::star::util::NumberFormatter

Method Details



attachNumberFormatsSupplier

Syntax

void attachNumberFormatsSupplier (
com::sun::star::util::XNumberFormatsSupplier xSupplier );

Description

attaches an XNumberFormatsSupplier to this NumberFormatter .

This NumberFormatter will only use the NumberFormats specified in the attached XNumberFormatsSupplier . Without an attached XNumberFormatsSupplier , no formatting is possible.


getNumberFormatsSupplier

Syntax

com::sun::star::util::XNumberFormatsSupplier getNumberFormatsSupplier ();

Returns

the attached NumberFormatsSupplier .

detectNumberFormat

Syntax

long detectNumberFormat (
long nKey,
string aString )
raises ( com::sun::star::util::NotNumericException );

Description

detects the number format in a string which contains a formatted number.


convertStringToNumber

Syntax

double convertStringToNumber (
long nKey,
string aString )
raises ( com::sun::star::util::NotNumericException );

Description

converts a string which contains a formatted number into a number.

If this is a text format, the string will not be converted.


convertNumberToString

Syntax

string convertNumberToString (
long nKey,
double fValue );

Description

converts a number into a string.


queryColorForNumber

Syntax

com::sun::star::util::color queryColorForNumber (
long nKey,
double fValue,
com::sun::star::util::color aDefaultColor );

Returns

the color which is specified for the given value in the number format, which is otherwise the value of aDefaultColor .

formatString

Syntax

string formatString (
long nKey,
string aString );

Description

converts a string into another string.


queryColorForString

Syntax

com::sun::star::util::color queryColorForString (
long nKey,
string aString,
com::sun::star::util::color aDefaultColor );

Returns

the color which is specified for the given string in the number format, which is otherwise the value of aDefaultColor .

getInputString

Syntax

string getInputString (
long nKey,
double fValue );

Description

converts a number into a string with the specified format.

This string can always be converted back to a number using the same format.

Top of Page