LibreOffice LibreOffice 25.8 SDK API Reference

Public Member Functions | List of all members
XNumberFormatPreviewer Interface Referencepublished

represents a number formatter which can preview number formats without inserting them. More...

`import"XNumberFormatPreviewer.idl";`

Inheritance diagram for XNumberFormatPreviewer:

## Public Member Functions
string | convertNumberToPreviewString ([in] string aFormat, [in] double fValue, [in] com::sun::star::lang::Locale nLocale, [in] boolean bAllowEnglish) raises ( com::sun::star::util::MalformedNumberFormatException )
| formats a value using a format string, without inserting a number format into the list. More...
com::sun::star::util::Color | queryPreviewColorForNumber ([in] string aFormat, [in] double fValue, [in] com::sun::star::lang::Locale nLocale, [in] boolean bAllowEnglish, [in] com::sun::star::util::Color aDefaultColor) raises ( com::sun::star::util::MalformedNumberFormatException )
| returns the color which is to be used for a number. More...
Public Member Functions inherited from XInterface
any | queryInterface ([in] type aType)
| queries for a new interface to an existing UNO object. More...
void | acquire ()
| increases the reference counter by one. More...
void | release ()
| decreases the reference counter by one. More...

## Detailed Description

represents a number formatter which can preview number formats without inserting them.

See also
  NumberFormatter

Developers Guide
  Office Development - Number Formats

## Member Function Documentation

## ◆ convertNumberToPreviewString()

string convertNumberToPreviewString | ( | [in] string | aFormat,
|  | [in] double | fValue,
|  | [in] com::sun::star::lang::Locale | nLocale,
|  | [in] boolean | bAllowEnglish
| ) |  |
raises | ( | com::sun::star::util::MalformedNumberFormatException
| ) |  |

formats a value using a format string, without inserting a number format into the list.

Parameters

  aFormat | is the format string that is used for formatting.
  fValue | is the value that is formatted.
  nLocale | is the locale that is used to interpret the format string.
  bAllowEnglish | specifies if English language number format strings are accepted in addition to those from the selected locale.

Returns
  the formatted string.

Exceptions

  com::sun::star::util::MalformedNumberFormatException | if the format string is invalid.

## ◆ queryPreviewColorForNumber()

com::sun::star::util::Color queryPreviewColorForNumber | ( | [in] string | aFormat,
|  | [in] double | fValue,
|  | [in] com::sun::star::lang::Locale | nLocale,
|  | [in] boolean | bAllowEnglish,
|  | [in] com::sun::star::util::Color | aDefaultColor
| ) |  |
raises | ( | com::sun::star::util::MalformedNumberFormatException
| ) |  |

returns the color which is to be used for a number.

Parameters

  aFormat | is the format string that is used for formatting.
  fValue | is the value that is formatted.
  nLocale | is the locale that is used to interpret the format string.
  bAllowEnglish | specifies if English language number format strings are accepted in addition to those from the selected locale.
  aDefaultColor | is the color that should be returned if no color is set by the number format.

Returns
  the color that should used to output the formatted string.

Exceptions

  com::sun::star::util::MalformedNumberFormatException | if the format string is invalid.

The documentation for this interface was generated from the following file:

- com/sun/star/util/XNumberFormatPreviewer.idl