Hi Samphan,

On Fri, Oct 14, 2005 at 18:28:14 +0700, Samphan Raruenrom wrote:

> 1) In the XML file, I see entries like
> <FormatCode>[$฿-41E]#,##0;-[$฿-41E]#,##0</FormatCode>
> Where ฿ is Thai currency (Baht) sign and (as of my understanding)
> 41E is Thai locale code (right?).

Correct.

> I also see this format code in Calc
> #,##0.00 [$THB];-#,##0.00 [$THB]
> 
> I'm wondering whether [$ and ] is needed.

It is, to properly identify and categorize the format as a currency
format.

> That is,
> in the above case, I can't just say
> #,##0.00 THB;-#,##0.00 THB

It may work sometimes, depending on whether the letters have a keyword
meaning and on the context, but should not be used. It is an
implementation detail that may change any time.

> Since I want to have a format that say
> #,##0.00 บาท;-#,##0.00 บาท
> (บาท is Baht in Thai)
> Should I write it like this?
> #,##0.00 [$บาท];-#,##0.00 [$บาท]

For proper identification with the locale the LCID 41E should be
appended to the currency symbol, with a dash in between, so
#,##0.00 [$บาท-41E];-#,##0.00 [$บาท-41E]
would be the complete form. The form without the LCID should only be
used with the ISO 4217 currency code abbreviations AKA BankSymbol.


> 2) In the locale XML files, I see
> <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium"
> usage="CURRENCY"  formatindex="16">
> <FormatCode>#,##0.00 CCC</FormatCode>
> <DefaultName></DefaultName>
> </FormatElement>
> 
> But I don't see a corresponding entry in Calc?

On purpose ;-)  It's an old legacy format and the string displayed in
place of the CCC changes its actual value depending on the locale under
which the document is displayed, which for currencies in 99% of all
cases is not what you want.. Btw, you still may see the entry if you
search long enough ;-)  just don't use it in documents. We needed it to
be able to load documents in the binary file format, but now that we
have project binfilter we may as well remove that format and others in
future releases.


> 3) In Calc I see two format code
> #,##0.00 [$THB];-#,##0.00 [$THB]
> #,##0.00 [$THB];[RED]-#,##0.00 [$THB]
> 
> Which I don't see in the locale data file.
> Where they come from?

They're generated for each locale from the definitions of the
LC_CURRENCY element and the details encountered in the medium default
format, such as where the currency symbol's position is, how negative
amounts are expressed and so on. Note that in the format codes you
normally only specify format codes for just one currency, the one for
which <Currency usedInCompatibleFormatCodes="true"> is set. Again, this
is/was needed for legacy documents. There may be more than one currency
though for a locale, or transitions of currencies may have occurred,
like from DeutscheMark to Euro in Germany, see de_DE.xml

  Eike

-- 
 OOo/SO Calc core developer. Number formatter bedevilled I18N transpositionizer.
 GnuPG key 0x293C05FD:  997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to