format currency

Discussion in 'ASP .Net' started by David C, Jun 21, 2009.

  1. David C

    David C Guest

    I am using DataFormatstring as "{0:c"} for a money column and it works
    great. However, I would like to have $0.00 (zero values) show as Null or
    blank. What do I need to add to my format string? Thanks.

    David
    David C, Jun 21, 2009
    #1
    1. Advertising

  2. David C

    David C Guest

    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "David C" <> wrote in message
    > news:...
    >
    >> I am using DataFormatstring as "{0:c"} for a money column and it works
    >> great. However, I would like to have $0.00 (zero values) show as Null or
    >> blank. What do I need to add to my format string?

    >
    > http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
    > Do a search for "Three sections"
    >
    > See also:
    > http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.nulldisplaytext.aspx
    > http://msdn.microsoft.com/en-us/lib...rols.boundfield.convertemptystringtonull.aspx
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net


    That worked. I ended up with the following and since a space was in the 3rd
    param it displayed blank.

    # Bind("SellingPrice", "{0:$#,##0.00;($#,##0.00); }")

    Thanks for your info.

    David
    David C, Jun 21, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Biao Tang
    Replies:
    0
    Views:
    459
    Biao Tang
    Apr 28, 2005
  2. TJS
    Replies:
    0
    Views:
    475
  3. D. Shane Fowlkes

    Format DataItem 'inline' as Currency/String?

    D. Shane Fowlkes, Jun 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,889
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Jun 9, 2005
  4. VB Programmer

    Format Currency for label

    VB Programmer, Sep 14, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    7,074
    VB Programmer
    Sep 14, 2005
  5. JeffP@Laptop

    How do I Format Currency w/out decimals?

    JeffP@Laptop, Dec 13, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    15,728
    =?Utf-8?B?RWx0b24gVw==?=
    Dec 15, 2005
Loading...

Share This Page