Results 1 to 4 of 4

Thread: ASP Page

  1. #1
    New Lounger
    Join Date
    Apr 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP Page

    Hello, I have a database which mostly consists of text fields. I do have one field that is formatted to currency.
    I need this field to show up on my asp page as currency not as text.
    It should look like this is the table $1,000,000.00 not like this 100000000

    I hope someone can help

    Thanks
    PR.
    hotski57@yahoo.com
    I hope you all can help

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: ASP Page

    Are you using VBScript as your language? If so, take a look at the FormatCurrency function. (I don't know JScript well enough to know the counterpart function...)

  3. #3
    New Lounger
    Join Date
    Apr 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ASP Page

    OK But how and where do I put this script. I sure do appricate the help.

    Thanks Paula

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: ASP Page

    I can't test this right now, but here's what I suggest. There are two ways that your database value might be getting inserted right now:

    Style#1:

    <UL>Your page is mostly HTML code, but where the value should appear is a tag something like this:

    <%=myRecordset.Fields("GrandTotal")%>

    You could format that data value using FormatCurrency:

    <%=FormatCurrency(myRecordset.Fields("GrandTotal") )%>[/list]Style#2:
    <UL>Your page is mostly ASP code and contains many lines starting with Response.Write, including the line that contains the data value you want to format. So you should find the line something like this:

    Response.Write "Total = " & myRecordset.Fields("GrandTotal") & "" & vbCrLf

    And add the formatting function like so:

    Response.Write "Total = " & FormatCurrency(myRecordset.Fields("GrandTotal")) & "" & vbCrLf[/list]If this only makes the headache worse, perhaps you can post the existing code that needs to be edited?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •