currency format

Discussion in 'ASP .Net' started by Mike, Feb 14, 2008.

  1. Mike

    Mike Guest

    I have to format a number in currency format but I don't want the decimals.

    I want it to look like

    $4545

    and not

    $4545.60

    I have this for my format:
    dr["GrossExpense"] = Convert.ToInt32(GrossAmount).ToString("c");

    but its displaying as $4545.60. How can I get it to show without the
    decimals (.60)?
     
    Mike, Feb 14, 2008
    #1
    1. Advertising

  2. Mike

    Mike Guest

    I figured it out.

    I have to use
    dr["GrossExpense"] = Convert.ToInt32(GrossAmount).ToString("c0");


    "Mike" <> wrote in message
    news:...
    >I have to format a number in currency format but I don't want the decimals.
    >
    > I want it to look like
    >
    > $4545
    >
    > and not
    >
    > $4545.60
    >
    > I have this for my format:
    > dr["GrossExpense"] = Convert.ToInt32(GrossAmount).ToString("c");
    >
    > but its displaying as $4545.60. How can I get it to show without the
    > decimals (.60)?
    >
    >
    >
    >
     
    Mike, Feb 14, 2008
    #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:
    468
    Biao Tang
    Apr 28, 2005
  2. TJS
    Replies:
    0
    Views:
    484
  3. D. Shane Fowlkes

    Format DataItem 'inline' as Currency/String?

    D. Shane Fowlkes, Jun 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,913
    =?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,104
    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,763
    =?Utf-8?B?RWx0b24gVw==?=
    Dec 15, 2005
Loading...

Share This Page