TLDR: What goes between the $
and -
in the locale code defines the currency symbol to use in the number format(more specifically nothing for: [$-409]
).
Excel is old tech, so when you start digging into the details you'll start to notice some of the "baggage"(a.k.a. tech-debt) that's leftover from a bygone era, and this appears to be one of those things that has not aged very well in the documentation.
Here's the story as best as I was able to piece together:
in section 2.1.378 item b. of MS-OE376 - v20160623 it mentions:
NFPartLocaleID = ASCII-LEFT-SQUARE-BRACKET ASCII-DOLLAR-SIGN 1*UTF16-ANY [ASCII-HYPHEN-MINUS 3*8ASCII-DIGIT-HEXADECIMAL] ASCII-RIGHT-SQUARE-BRACKET
in Part 4 section 3.8.31 of the ECMA-376 (1st Edition / Dec 2006) specification, towards the end there is a table of International Considerations in which the final entry mentions:
Format Code |
Description |
[$USD-409] |
Specifies currency and locale/date system/number system information.
Syntax is [$<Currency String>-<language info>]. Currency string is a string to use as a currency symbol. Language info is a 32-bit value entered in hexidecimal format.
Language info format (byte 3 is most significant byte): Bytes 0,1: 16-bit Language ID (LID). Byte 2: Calendar type. High bit indicates that input is parsed using specified calendar. Byte 3: Number system type. High bit indicates that input is parsed using specified number system. |
next going to the remnants of the MSDN tech doc's to try and find out what is a locale ID, it mentions some insights into what the structure of a 32-bit LCID used to be back when Excel was still a Win32 app:
[$-409] NFPartLocaleID
0x00000409 <Language info>
0 0 0 0 0 4 0 9
0000 0000 0000 0000 0000 0100 0000 1001
+----------+----------+----------+----------+----------+----------+----------+----------+
3 2 1 0 byte
+---------------------------------------------------------------------------------------+
| Locale Identifier |
+--------------------------------+----------+-------------------------------------------+
| Reserved | Sort ID | Language ID |
+--------------------------------+----------+---------------------+---------------------+
31 20 19 16| SubLanguage ID | Primary Language ID |
+---------------------+---------------------+
15 10 9 0 bit
finally going to MS-LCID v15.0 in section 2.2 there is a Language ID(2 bytes) table that mentions:
Language ID |
Language tag |
0x0409 |
en-US |
So to me the [$-409]
in [$-409]d h:mm:ss
would read as en-US with no currency symbol defined that formats 12.34
as 12 8:09:36
, whereas [$$-409] 0.00
or [$USD-409] 0.00
which would format it as $ 12.34
and USD 12.34
respectively.