LibreOffice
LibreOffice 7.4 SDK API Reference
Variables
com::sun::star::i18n::NumberFormatIndex Constant Group Referencepublished

Do NOT insert any new values! Locale data number format creation must match these values! Number formatter internals must match these values! More...

Variables

const short NUMBER_START = 0
 Start of simple numerical formats (first format) More...
 
const short NUMBER_STANDARD = NUMBER_START
 The "General" standard format
formatindex="0". More...
 
const short NUMBER_INT = NUMBER_START+1
 0
Integer number
formatindex="1" More...
 
const short NUMBER_DEC2 = NUMBER_START+2
 0.00
Decimal number with 2 decimals
formatindex="2" More...
 
const short NUMBER_1000INT = NUMBER_START+3
 #,##0
Integer number with group separator
formatindex="3" More...
 
const short NUMBER_1000DEC2 = NUMBER_START+4
 #,##0.00
Decimal number with group separator
formatindex="4" More...
 
const short NUMBER_SYSTEM = NUMBER_START+5
 #,##0.00
In SO5/Win this format was retrieved from the Regional Settings
formatindex="5" More...
 
const short NUMBER_END = NUMBER_SYSTEM
 End of simple numerical formats (last format) More...
 
const short SCIENTIFIC_START = NUMBER_END+1
 Start of Scientific formats (first format) More...
 
const short SCIENTIFIC_000E000 = SCIENTIFIC_START
 0.00E+000
Number in scientific notation with exponent in 3 digit placeholders
formatindex="6" More...
 
const short SCIENTIFIC_000E00 = SCIENTIFIC_START+1
 0.00E+00
Number in scientific notation with exponent in 2 digit placeholders
formatindex="7" More...
 
const short SCIENTIFIC_END = SCIENTIFIC_000E00
 End of Scientific formats (last format) More...
 
const short PERCENT_START = SCIENTIFIC_END+1
 Start of Percent formats (first format) More...
 
const short PERCENT_INT = PERCENT_START
 0%
Percentage format, rounded to integer
formatindex="8" More...
 
const short PERCENT_DEC2 = PERCENT_START+1
 0.00%
Percentage format, rounded to 2 decimals
formatindex="9" More...
 
const short PERCENT_END = PERCENT_DEC2
 End of Percent formats (last format) More...
 
const short FRACTION_START = PERCENT_END+1
 Start of Fraction formats (first format) More...
 
const short FRACTION_1 = FRACTION_START
 
const short FRACTION_2 = FRACTION_START+1
 
const short FRACTION_END = FRACTION_2
 End of Fraction formats (last format) More...
 
const short CURRENCY_START = FRACTION_END+1
 Start of Currency formats (first format) More...
 
const short CURRENCY_1000INT = CURRENCY_START
 #,##0 DM
Integer currency format with group separator
formatindex="12" More...
 
const short CURRENCY_1000DEC2 = CURRENCY_START+1
 #,##0.00 DM
Decimal currency format with group separator
formatindex="13" More...
 
const short CURRENCY_1000INT_RED = CURRENCY_START+2
 #,##0 DM
Integer currency format with negative in red
formatindex="14" More...
 
const short CURRENCY_1000DEC2_RED = CURRENCY_START+3
 #,##0.00 DM
Decimal currency format with negative in red
formatindex="15" More...
 
const short CURRENCY_1000DEC2_CCC = CURRENCY_START+4
 #,##0.00 DEM
Currency in ISO-4217 abbreviation format
formatindex="16" More...
 
const short CURRENCY_1000DEC2_DASHED = CURRENCY_START+5
 #,##0.– DM
Currency format with dash representing 0 in decimals
formatindex="17" More...
 
const short CURRENCY_END = CURRENCY_1000DEC2_DASHED
 End of Currency formats (last format) More...
 
const short DATE_START = CURRENCY_END+1
 Start of Date formats (first format) More...
 
const short DATE_SYSTEM_SHORT = DATE_START
 08.10.97
see also DATE_SYSTEM_... explanation
formatindex="18" More...
 
const short DATE_SYSTEM_LONG = DATE_START+1
 Wednesday, 8. More...
 
const short DATE_SYS_DDMMYY = DATE_START+2
 08.10.97
see also DATE_SYS_... explanation
formatindex="20" More...
 
const short DATE_SYS_DDMMYYYY = DATE_START+3
 08.10.1997
see also DATE_SYS_... More...
 
const short DATE_SYS_DMMMYY = DATE_START+4
 
const short DATE_SYS_DMMMYYYY = DATE_START+5
 
const short DATE_DIN_DMMMYYYY = DATE_START+6
 
const short DATE_SYS_DMMMMYYYY = DATE_START+7
 
const short DATE_DIN_DMMMMYYYY = DATE_START+8
 
const short DATE_SYS_NNDMMMYY = DATE_START+9
 Wed, 8. Oct 97
see also DATE_SYS_... explanation
formatindex="27". More...
 
const short DATE_DEF_NNDDMMMYY = DATE_START+10
 Wed 08.Oct 97
see also DATE_DEF_... explanation
formatindex="28". More...
 
const short DATE_SYS_NNDMMMMYYYY = DATE_START+11
 Wed, 8. October 1997
see also DATE_SYS_... explanation
formatindex="29". More...
 
const short DATE_SYS_NNNNDMMMMYYYY = DATE_START+12
 Wednesday, 8. October 1997
formatindex="30". More...
 
const short DATE_DIN_MMDD = DATE_START+13
 10-08
DIN/EN
formatindex="31" More...
 
const short DATE_DIN_YYMMDD = DATE_START+14
 97-10-08
DIN/EN
formatindex="32" More...
 
const short DATE_DIN_YYYYMMDD = DATE_START+15
 1997-10-08
DIN/EN/ISO
formatindex="33" More...
 
const short DATE_SYS_MMYY = DATE_START+16
 10.97
see also DATE_SYS_... explanation
formatindex="34" More...
 
const short DATE_SYS_DDMMM = DATE_START+17
 08.Oct
see also DATE_SYS_... explanation
formatindex="35" More...
 
const short DATE_MMMM = DATE_START+18
 October
formatindex="36". More...
 
const short DATE_QQJJ = DATE_START+19
 4th quarter 97
formatindex="37" More...
 
const short DATE_WW = DATE_START+20
 week of year
formatindex="38" More...
 
const short DATE_END = DATE_WW
 End of Date formats (last format) More...
 
const short TIME_START = DATE_END+1
 Start of Time formats (first format) More...
 
const short TIME_HHMM = TIME_START
 HH:MM
Time format with hour and minute
formatindex="39". More...
 
const short TIME_HHMMSS = TIME_START+1
 HH:MM:SS
Time format with hour, minute and second
formatindex="40". More...
 
const short TIME_HHMMAMPM = TIME_START+2
 HH:MM AM/PM
Time format with hour, minute and morning/afternoon notation
formatindex="41". More...
 
const short TIME_HHMMSSAMPM = TIME_START+3
 HH:MM:SS AM/PM
Time format with hour, minute, second and morning/afternoon notation
formatindex="42". More...
 
const short TIME_HH_MMSS = TIME_START+4
 [HH]:MM:SS
Time format with amount of hours
formatindex="43" More...
 
const short TIME_MMSS00 = TIME_START+5
 MM:SS,00
Time format with second in fraction
formatindex="44". More...
 
const short TIME_HH_MMSS00 = TIME_START+6
 [HH]:MM:SS,00
Time format with amount of hours and seconds with fraction
formatindex="45" More...
 
const short TIME_END = TIME_HH_MMSS00
 End of Time formats (last format) More...
 
const short DATETIME_START = TIME_END + 1
 Start of DateTime formats (first format) More...
 
const short DATETIME_SYSTEM_SHORT_HHMM = DATETIME_START
 08.10.97 01:23 Date/time format
formatindex="46" More...
 
const short DATETIME_SYS_DDMMYYYY_HHMMSS = DATETIME_START+1
 08.10.1997 01:23:45 Date/time format with second
Note: When editing already existing date/time data this format is forced in order to always edit the full century. More...
 
const short DATETIME_END = DATETIME_SYS_DDMMYYYY_HHMMSS
 End of DateTime formats (last format) More...
 
const short BOOLEAN = DATETIME_END+1
 BOOLEAN format. More...
 
const short TEXT = BOOLEAN+1
 Text format. More...
 
const short INDEX_TABLE_ENTRIES = TEXT+1
 count of built-in format codes. More...
 

Detailed Description

Do NOT insert any new values! Locale data number format creation must match these values! Number formatter internals must match these values!

Number format indices to be passed as the index argument to XNumberFormatCode::getFormatCode() or com::sun::star::util::XNumberFormatTypes::getFormatIndex().

Each locale can support up to about 5000 arbitrary format codes. But for backward compatibility reasons, each locale MUST support some predefined format codes. These predefined format codes are accessed through indices as the following, and the locale data format code definitions in i18npool/source/localedata/data/*.xml MUST have matching entries in the form

<FormatElement formatindex="0">

(see also FormatElement::formatIndex()).

The index values are also used to define the enum NfIndexTableOffset in file svtools/inc/zforlist.hxx

Note: This index has nothing to do with the index key used internally by the number formatter.


Date formats may have a comment of DIN/EN/ISO, meaning

Some names of date format constants indicate a special behavior of those formats in StarOffice 5.2 or older. Those are:

DATE_SYSTEM_...

On Windows platforms these formats were entirely retrieved from the system's Regional Settings. OpenOffice.org / StarOffice 6 don't use those Windows settings anymore in order to provide the same functionality and document layout on every platform. Like all other formats these formats are now defined in the i18n framework locale data files under i18npool/source/localedata/data/*.xml

DATE_SYS_...

On Windows platforms these formats used separators and YMD order retrieved from the Regional Settings, but appearance of short/long days/months/years was defined by the application.

DATE_DEF_...

The format code was hard defined, only the date separator was taken from the Windows Regional Settings, but not the YMD order.

Variable Documentation

◆ BOOLEAN

const short BOOLEAN = DATETIME_END+1

BOOLEAN format.

Attention
Not defined in locale data, but generated by the number formatter. If you want to access this format you MUST do it via com::sun::star::util::XNumberFormatTypes::getFormatIndex() instead of XNumberFormatCode::getFormatCode().
reserved formatindex="48"

◆ CURRENCY_1000DEC2

const short CURRENCY_1000DEC2 = CURRENCY_START+1

#,##0.00 DM
Decimal currency format with group separator
formatindex="13"

◆ CURRENCY_1000DEC2_CCC

const short CURRENCY_1000DEC2_CCC = CURRENCY_START+4

#,##0.00 DEM
Currency in ISO-4217 abbreviation format
formatindex="16"

◆ CURRENCY_1000DEC2_DASHED

const short CURRENCY_1000DEC2_DASHED = CURRENCY_START+5

#,##0.– DM
Currency format with dash representing 0 in decimals
formatindex="17"

◆ CURRENCY_1000DEC2_RED

const short CURRENCY_1000DEC2_RED = CURRENCY_START+3

#,##0.00 DM
Decimal currency format with negative in red
formatindex="15"

◆ CURRENCY_1000INT

const short CURRENCY_1000INT = CURRENCY_START

#,##0 DM
Integer currency format with group separator
formatindex="12"

◆ CURRENCY_1000INT_RED

const short CURRENCY_1000INT_RED = CURRENCY_START+2

#,##0 DM
Integer currency format with negative in red
formatindex="14"

◆ CURRENCY_END

const short CURRENCY_END = CURRENCY_1000DEC2_DASHED

End of Currency formats (last format)

◆ CURRENCY_START

const short CURRENCY_START = FRACTION_END+1

Start of Currency formats (first format)

◆ DATE_DEF_NNDDMMMYY

const short DATE_DEF_NNDDMMMYY = DATE_START+10

Wed 08.Oct 97
see also DATE_DEF_... explanation
formatindex="28".

◆ DATE_DIN_DMMMMYYYY

const short DATE_DIN_DMMMMYYYY = DATE_START+8
  1. October 1997
    DIN/EN
    formatindex="26"

◆ DATE_DIN_DMMMYYYY

const short DATE_DIN_DMMMYYYY = DATE_START+6
  1. Oct. 1997
    DIN/EN
    formatindex="24"

◆ DATE_DIN_MMDD

const short DATE_DIN_MMDD = DATE_START+13

10-08
DIN/EN
formatindex="31"

◆ DATE_DIN_YYMMDD

const short DATE_DIN_YYMMDD = DATE_START+14

97-10-08
DIN/EN
formatindex="32"

◆ DATE_DIN_YYYYMMDD

const short DATE_DIN_YYYYMMDD = DATE_START+15

1997-10-08
DIN/EN/ISO
formatindex="33"

◆ DATE_END

const short DATE_END = DATE_WW

End of Date formats (last format)

◆ DATE_MMMM

const short DATE_MMMM = DATE_START+18

October
formatindex="36".

◆ DATE_QQJJ

const short DATE_QQJJ = DATE_START+19

4th quarter 97
formatindex="37"

◆ DATE_START

const short DATE_START = CURRENCY_END+1

Start of Date formats (first format)

◆ DATE_SYS_DDMMM

const short DATE_SYS_DDMMM = DATE_START+17

08.Oct
see also DATE_SYS_... explanation
formatindex="35"

◆ DATE_SYS_DDMMYY

const short DATE_SYS_DDMMYY = DATE_START+2

08.10.97
see also DATE_SYS_... explanation
formatindex="20"

◆ DATE_SYS_DDMMYYYY

const short DATE_SYS_DDMMYYYY = DATE_START+3

08.10.1997
see also DATE_SYS_...

explanation
Note: When editing already existing date data this format is forced in order to always edit the full century.
formatindex="21"

◆ DATE_SYS_DMMMMYYYY

const short DATE_SYS_DMMMMYYYY = DATE_START+7
  1. October 1997
    see also DATE_SYS_... explanation
    formatindex="25"

◆ DATE_SYS_DMMMYY

const short DATE_SYS_DMMMYY = DATE_START+4
  1. Oct 97
    see also DATE_SYS_... explanation
    formatindex="22"

◆ DATE_SYS_DMMMYYYY

const short DATE_SYS_DMMMYYYY = DATE_START+5
  1. Oct 1997
    see also DATE_SYS_... explanation
    formatindex="23"

◆ DATE_SYS_MMYY

const short DATE_SYS_MMYY = DATE_START+16

10.97
see also DATE_SYS_... explanation
formatindex="34"

◆ DATE_SYS_NNDMMMMYYYY

const short DATE_SYS_NNDMMMMYYYY = DATE_START+11

Wed, 8. October 1997
see also DATE_SYS_... explanation
formatindex="29".

◆ DATE_SYS_NNDMMMYY

const short DATE_SYS_NNDMMMYY = DATE_START+9

Wed, 8. Oct 97
see also DATE_SYS_... explanation
formatindex="27".

◆ DATE_SYS_NNNNDMMMMYYYY

const short DATE_SYS_NNNNDMMMMYYYY = DATE_START+12

Wednesday, 8. October 1997
formatindex="30".

◆ DATE_SYSTEM_LONG

const short DATE_SYSTEM_LONG = DATE_START+1

Wednesday, 8.

October 1997
see also DATE_SYSTEM_... explanation
formatindex="19"

◆ DATE_SYSTEM_SHORT

const short DATE_SYSTEM_SHORT = DATE_START

08.10.97
see also DATE_SYSTEM_... explanation
formatindex="18"

◆ DATE_WW

const short DATE_WW = DATE_START+20

week of year
formatindex="38"

◆ DATETIME_END

const short DATETIME_END = DATETIME_SYS_DDMMYYYY_HHMMSS

End of DateTime formats (last format)

◆ DATETIME_START

const short DATETIME_START = TIME_END + 1

Start of DateTime formats (first format)

◆ DATETIME_SYS_DDMMYYYY_HHMMSS

const short DATETIME_SYS_DDMMYYYY_HHMMSS = DATETIME_START+1

08.10.1997 01:23:45 Date/time format with second
Note: When editing already existing date/time data this format is forced in order to always edit the full century.


formatindex="47"

◆ DATETIME_SYSTEM_SHORT_HHMM

const short DATETIME_SYSTEM_SHORT_HHMM = DATETIME_START

08.10.97 01:23 Date/time format
formatindex="46"

◆ FRACTION_1

const short FRACTION_1 = FRACTION_START

?/? <br/>Number with decimal in fraction in 1 digit placeholder <br/> formatindex="10"

◆ FRACTION_2

const short FRACTION_2 = FRACTION_START+1

??/?? <br/>Number with decimal in fraction in 2 digit placeholders <br/> formatindex="11"

◆ FRACTION_END

const short FRACTION_END = FRACTION_2

End of Fraction formats (last format)

◆ FRACTION_START

const short FRACTION_START = PERCENT_END+1

Start of Fraction formats (first format)

◆ INDEX_TABLE_ENTRIES

const short INDEX_TABLE_ENTRIES = TEXT+1

count of built-in format codes.

◆ NUMBER_1000DEC2

const short NUMBER_1000DEC2 = NUMBER_START+4

#,##0.00
Decimal number with group separator
formatindex="4"

◆ NUMBER_1000INT

const short NUMBER_1000INT = NUMBER_START+3

#,##0
Integer number with group separator
formatindex="3"

◆ NUMBER_DEC2

const short NUMBER_DEC2 = NUMBER_START+2

0.00
Decimal number with 2 decimals
formatindex="2"

◆ NUMBER_END

const short NUMBER_END = NUMBER_SYSTEM

End of simple numerical formats (last format)

◆ NUMBER_INT

const short NUMBER_INT = NUMBER_START+1

0
Integer number
formatindex="1"

◆ NUMBER_STANDARD

const short NUMBER_STANDARD = NUMBER_START

The "General" standard format
formatindex="0".

◆ NUMBER_START

const short NUMBER_START = 0

Start of simple numerical formats (first format)

◆ NUMBER_SYSTEM

const short NUMBER_SYSTEM = NUMBER_START+5

#,##0.00
In SO5/Win this format was retrieved from the Regional Settings
formatindex="5"

◆ PERCENT_DEC2

const short PERCENT_DEC2 = PERCENT_START+1

0.00%
Percentage format, rounded to 2 decimals
formatindex="9"

◆ PERCENT_END

const short PERCENT_END = PERCENT_DEC2

End of Percent formats (last format)

◆ PERCENT_INT

const short PERCENT_INT = PERCENT_START

0%
Percentage format, rounded to integer
formatindex="8"

◆ PERCENT_START

const short PERCENT_START = SCIENTIFIC_END+1

Start of Percent formats (first format)

◆ SCIENTIFIC_000E00

const short SCIENTIFIC_000E00 = SCIENTIFIC_START+1

0.00E+00
Number in scientific notation with exponent in 2 digit placeholders
formatindex="7"

◆ SCIENTIFIC_000E000

const short SCIENTIFIC_000E000 = SCIENTIFIC_START

0.00E+000
Number in scientific notation with exponent in 3 digit placeholders
formatindex="6"

◆ SCIENTIFIC_END

const short SCIENTIFIC_END = SCIENTIFIC_000E00

End of Scientific formats (last format)

◆ SCIENTIFIC_START

const short SCIENTIFIC_START = NUMBER_END+1

Start of Scientific formats (first format)

◆ TEXT

const short TEXT = BOOLEAN+1

Text format.

Attention
Not defined in locale data, but generated by the number formatter. If you want to access this format you MUST do it via com::sun::star::util::XNumberFormatTypes::getFormatIndex() instead of XNumberFormatCode::getFormatCode()
reserved formatindex="49"

◆ TIME_END

const short TIME_END = TIME_HH_MMSS00

End of Time formats (last format)

◆ TIME_HH_MMSS

const short TIME_HH_MMSS = TIME_START+4

[HH]:MM:SS
Time format with amount of hours
formatindex="43"

◆ TIME_HH_MMSS00

const short TIME_HH_MMSS00 = TIME_START+6

[HH]:MM:SS,00
Time format with amount of hours and seconds with fraction
formatindex="45"

◆ TIME_HHMM

const short TIME_HHMM = TIME_START

HH:MM
Time format with hour and minute
formatindex="39".

◆ TIME_HHMMAMPM

const short TIME_HHMMAMPM = TIME_START+2

HH:MM AM/PM
Time format with hour, minute and morning/afternoon notation
formatindex="41".

◆ TIME_HHMMSS

const short TIME_HHMMSS = TIME_START+1

HH:MM:SS
Time format with hour, minute and second
formatindex="40".

◆ TIME_HHMMSSAMPM

const short TIME_HHMMSSAMPM = TIME_START+3

HH:MM:SS AM/PM
Time format with hour, minute, second and morning/afternoon notation
formatindex="42".

◆ TIME_MMSS00

const short TIME_MMSS00 = TIME_START+5

MM:SS,00
Time format with second in fraction
formatindex="44".

◆ TIME_START

const short TIME_START = DATE_END+1

Start of Time formats (first format)