How to read Decimal from SQL in ASP Classic?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pheddy
    New Member
    • Dec 2008
    • 80

    #1

    How to read Decimal from SQL in ASP Classic?

    Hi All!

    I have run into a problem where I need to display a number from my SQL Server 2008 where the column is decimal(13, 2)

    But it allways ends up messing with the number. 2,0 becomes 20 1,5 becomes 15 and so on.

    I have added
    Code:
    <%  Session.LCID = 1033 %>
    For the site to be able to communicate with PayPal and others.

    Ive also tried different combinations of formatNumber and CCur, but I cant seem to find the right way..

    Any idea?

    Thanks.
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    You need to remember that microsoft is an american company. In america we do not use a comma (,) for decimals. We use a period (.). Both asp and sql server are M$ technologies and follow the US standard unless you explicitly change the regional settings. So you have two options: 1- change the regional settings for both IIS and SQL server or 2- switch to the US standard of using periods for decimals.

    Jared

    Notice, this is also the reason SQL server always understands "3/10/2010" as "March 10, 2010" - in the US we say the month first.

    Comment

    Working...