Format output to currency

Discussion in 'ASP General' started by Micromanaged, May 26, 2004.

  1. Micromanaged

    Micromanaged Guest

    In my response.write line, I need to format a field to be a currency
    value. Is there a quick and dirty way to do it or is it an involved
    edit? Here is my code:

    Response.Write("<td>" & WhataRecordset.Fields.Item(0).Value &
    "</td><td>" & WhataRecordset.Fields.Item(1).Value & _
    "</td><td>" & WhataRecordset.Fields.Item(2).Value & "</td><td>" &
    WhataRecordset.Fields.Item(3).Value & _
    "</td><td>" & WhataRecordset.Fields.Item(4).Value & "</td><td>" &
    WhataRecordset.Fields.Item(5).Value & _
    "</td><td>" & WhataRecordset.Fields.Item(6).Value & "</td></tr>")

    The value written out in WhataRecordset.Fields.Item(2) is a monetary
    amount and should be formatted in the currency format.

    Thanks in advance.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Micromanaged, May 26, 2004
    #1
    1. Advertising

  2. Yes, have you tried the FormatCurrency() function? ;-)

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "Micromanaged" <> wrote in message
    news:...
    >
    >
    > In my response.write line, I need to format a field to be a currency
    > value. Is there a quick and dirty way to do it or is it an involved
    > edit? Here is my code:
    >
    > Response.Write("<td>" & WhataRecordset.Fields.Item(0).Value &
    > "</td><td>" & WhataRecordset.Fields.Item(1).Value & _
    > "</td><td>" & WhataRecordset.Fields.Item(2).Value & "</td><td>" &
    > WhataRecordset.Fields.Item(3).Value & _
    > "</td><td>" & WhataRecordset.Fields.Item(4).Value & "</td><td>" &
    > WhataRecordset.Fields.Item(5).Value & _
    > "</td><td>" & WhataRecordset.Fields.Item(6).Value & "</td></tr>")
    >
    > The value written out in WhataRecordset.Fields.Item(2) is a monetary
    > amount and should be formatted in the currency format.
    >
    > Thanks in advance.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Aaron Bertrand - MVP, May 26, 2004
    #2
    1. Advertising

  3. Micromanaged

    Micromanaged Guest

    It just barely dawned on me stupid brain after I posted the question.
    Long day and it is only half over.

    Thanks, though.

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Micromanaged, May 26, 2004
    #3
    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:
    483
    Biao Tang
    Apr 28, 2005
  2. TJS
    Replies:
    0
    Views:
    492
  3. D. Shane Fowlkes

    Format DataItem 'inline' as Currency/String?

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

Share This Page