format string for currency

  • Thread starter Thread starter John A Grandy
  • Start date Start date
J

John A Grandy

i thought the following would work for currency

{0:$000,000,000.00}

but it is displaying ( for example ) :

$000,025,368.87

i don't want the extra zeros ...
 
if i use "c" , the formatting then follows the
System.Globalization.CultureInfo.NumberFormat in effect for the page ,
correct ?
 
Hi,

yes

Ken
-----------------
John A Grandy said:
if i use "c" , the formatting then follows the
System.Globalization.CultureInfo.NumberFormat in effect for the page ,
correct ?
 
Ok ...

But what if I want a shorthand format-specifier that does not rely on any
more-global objects (such as CultureInfo). Must such specifiers always be
designated character-by-character ?

For example, if I want to display currency with a dollar-sign prefix, each
group of 3 digits separated by a comma, no decimal point or decimal places,
and blank for negative or zero values, then I would have to use something
like

"$###,###,###;;"

But how to cover the case where the currency value might be larger? (more
than 9 digits might need to be present)
 
again...
I have no MVP in my name so it is not good enough???

format {0:$###,##0.00} for 123456789 shows "123,456,789.00"
 
Back
Top