What does this number format do?

S

Simon Thorn

If I format a cell as a currency with symbol '$ French (Canada) the
custom format string generated is "#,##0.00 [$$-C0C]_-".. what does
the trailing minus sign do? It seems to have no effect when switching
between positive/negative/zero values..

Cheers,

Simon Thorn
XLCubed Ltd
 
D

Dave Peterson

Try this on a new worksheet.

Format A1 with this:
#,##0.00 [$$-C0C]_-

Format A2 with
#,##0.00 [$$-C0C]

Type 123.45 in A1 and B1

You'll see part of the difference.

The underscore tells excel to reserve the next character's width even if
(especially if) it's not used.

You can see it more in a format like:
_(#,##0_);(#,##0);_(0_);_(@_)

PositiveFormat;NegativeFormat;ZeroFormat;TextFormat

If the number is positive, then excel will reserve room for where the ()'s would
go. It makes things line up nicer.

(and same with zero and text values)


Simon said:
If I format a cell as a currency with symbol '$ French (Canada) the
custom format string generated is "#,##0.00 [$$-C0C]_-".. what does
the trailing minus sign do? It seems to have no effect when switching
between positive/negative/zero values..

Cheers,

Simon Thorn
XLCubed Ltd
 
S

Simon Thorn

Thanks for your reply Dave.. I already know that the underscore is
used for spacing but I'm still unclear as to what the purpose of the
trailing minus sign is - it doesn't seem to do anything..?

Cheers

Si.
 
J

JE McGimpsey

You don't understand *how* "the underscore is used for spacing".


The underscore indicates that enough space for the character that
follows it is to be inserted. So the width of the - sign *is* the amount
of space to be inserted.

If you wanted the width of the underscore inserted, you' use two of them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top