By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,868 Members | 1,991 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,868 IT Pros & Developers. It's quick & easy.

How to read Decimal from SQL in ASP Classic?

P: 80
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
Expand|Select|Wrap|Line Numbers
  1. <%  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.
Jan 12 '11 #1

✓ answered by jhardman

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.

Share this Question
Share on Google+
1 Reply


jhardman
Expert 2.5K+
P: 3,405
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.
Jan 13 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.