Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Currency Problem, Displaying without decimal places

    Hi I'm pretty new to ASP, and trying to learn it gradually.

    I have an ecommerce site using an Access database.

    It extracts the products through the ID numbers, as well as the prices.

    Everything else is working fine, but the only problem I see to encounter, is that when I save a price as £94.00, it displays in the page as £94... and for example £12.10, that would become £12.1.

    I need to try and sort this out, I have been trying to work it out for a few weeks, on and off, and really have come to a blank.

    I tried using the round feature with the 2 decimal places, command, hoping it would display as that, but still no luck.

    I got the price set as currency in access database, and 2 decimal places, but I'm sure the problem lies in the asp extraction process from the database.

    Also a relating problem, I have 2 prices in the database, one ex vat, and one inc vat, I need the ex vat table to automatically work out the ex vat price from the inc vat table, I know you have to use an expression builder,but after hours of fiddling, still stuck on square 1.

    I need the "ex vat" table to get the price from "inc vat" table and divide it by 1.175, thats all...

    Any help would be greatly appreciated, if I need to post any code, please just say and I will asap.

    Thanks a lot

    Jamie

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Use FormatNumber(). You can also use FormatCurrency() but the currency symbol used is I think the symbol set in the currency settings in the Regional Options of the server. If £ is set as the symbol then use FormatCurrency. But if you don't want to depend on the server settings, use FormatNumber.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for that mate,

    I'll give it a go, and hopefully it'll sort my dilemma.

    Thanks again.

    Jamie

  • #4
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks again buddy, had to modify it slightly because the query came from an access database.

    <%=formatcurrency(Recordset1.Fields.Item("SPRICE").Value,2,-1)%>

    Thats what worked, and will continue to use

    Thanks again, your a life saver (and time saver)

    Jamie


  •  

    Posting Permissions

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