Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


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

interface XNumberFormatter
Description
represents a number formatter.
Developers Guide
OfficeDev - Number Formats

Methods' 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.  
Methods' Details
attachNumberFormatsSupplier
void
attachNumberFormatsSupplier( [in] 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
XNumberFormatsSupplier
getNumberFormatsSupplier();

Returns
the attached XNumberFormatsSupplier.
detectNumberFormat
long
detectNumberFormat( [in] long  nKey,
[in] string  aString )
raises( NotNumericException );

Description
detects the number format in a string which contains a formatted number.
convertStringToNumber
double
convertStringToNumber( [in] long  nKey,
[in] string  aString )
raises( 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
string
convertNumberToString( [in] long  nKey,
[in] double  fValue );

Description
converts a number into a string.
queryColorForNumber
Color
queryColorForNumber( [in] long  nKey,
[in] double  fValue,
[in] Color  aDefaultColor );

Returns
the color which is specified for the given value in the number format, which is otherwise the value of aDefaultColor.
formatString
string
formatString( [in] long  nKey,
[in] string  aString );

Description
converts a string into another string.
queryColorForString
Color
queryColorForString( [in] long  nKey,
[in] string  aString,
[in] Color  aDefaultColor );

Returns
the color which is specified for the given string in the number format, which is otherwise the value of aDefaultColor.
getInputString
string
getInputString( [in] long  nKey,
[in] 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

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.