Solved

Decimal Separator problem with IIS in Windows 2000 Server .

Posted on 2003-10-24
10
1,854 Views
Last Modified: 2010-05-18
I am Using IIS 5.0 in Windows 2000 in order to deploy an ASP Web Site .  I have a problem when my ASP pages make some calculations and return a decimal value . The decimal value returned has a comma (,) as the decimal separator . I have the regional settings configured as follows:
- decimal  separator (.)
- thousand separator (,)

I even made a little program in vbasic to test decimal calculations and It works fine with the regional settings , It changes between comma and dot(.) if my regional settings are changed.
I tested some decimal calculations in the sql server and they work fine and SQL Server retrieves and stores data according to the operating system regional settings .
I even made changes in the sDecimal key in registry .

So I conclude the problem is IIS , How can I make IIS to show the same format for decimal numbers as in regional settings ?

Ps. Another Thing : In NT 4.0 everything works fine .

thank you for your help .
0
Comment
Question by:felixyo
  • 7
  • 3
10 Comments
 
LVL 19

Expert Comment

by:Dexstar
ID: 9617188
felixyo,
> I have a problem when my ASP pages make some calculations and return a decimal
> value . The decimal value returned has a comma (,) as the decimal separator .

Please post the offending ASP code.

Hope that helps,
Dex*
0
 
LVL 1

Author Comment

by:felixyo
ID: 9617364
Well as I said the code Works perfectly in (Windows NT 4.0  / IIS 3.0) , I don´t think the problem has to do with the code , but anyways ... This is the code :

I am showing this calculation in ASP :

Cint(RsData("UmbralBajoBateria"))*73/(1122*2)

RsData("UmbralBajoBateria") comes from an SQL Database and its value is 169

the ASP shows 5,49777183600713 (With comma) as the value of
Cint(RsData("UmbralBajoBateria"))*73/(1122*2)

This is not right because the regional settings are dot (.) for decimal places .
AsI told you this code works Ok in NT 4.0 .

0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9617446
I think it is one of two things:

A) The *system* regional settings are still set to use ",".  You may have only changed it for one user.

or

B)  It might be using the Regional Settings of the annoymous (IUSR_*) account, and not the system default settings.  Log in to the web server as that user, and check the regional settings for that user.

BTW, If you just want a quick fix, try this:
     Value = Replace(Cint(RsData("UmbralBajoBateria"))*73/(1122*2), ",", ".")

Just a thought.
Dex*
0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9617492
felixyo:

Does this work any better?
     FormatNumber( Cint(RsData("UmbralBajoBateria"))*73/(1122*2) )

It is supposed to force it to use the system's regional settings, according to this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctformatnumber.asp

Let me know,
Dex*
0
 
LVL 1

Author Comment

by:felixyo
ID: 9617629
Well those seem to be good ideas , I just tried them but It didn´t work .
I change the regional settings for IUSR_* and even for IWAM_* and nothing happens ; I used the FormatNumber function and It keeps showing the number with comma(,) ...

... I am giving some extra points , thanks .
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 19

Accepted Solution

by:
Dexstar earned 300 total points
ID: 9617759
felixyo,

You may have to restart the IIS Admin service for those changes to take effect.  If that doesn't work, then before you call FormatNumber(), add this command:
     Session.LCID = 1033

That should set the Locale ID that is to be used to do the formatting.  1033 is US English.


Come to think of it, I would be curious to know what the value of Session.LCID is before you set it.  That might point us in the right direction.

Dex*
0
 
LVL 1

Author Comment

by:felixyo
ID: 9617821
Ok . It seems to work ! , before changing the    Session.LCID value it had a value of 2048 , I am in a spanish environment , where can I see the values of  Session.LCID acording to the environment ?

0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9617853
felixyo,

I could tell you were in a Spanish environment from your Field Name of "UmbralBajoBateria".  :)  Anyway, here is a list of the LCIDs:
     http://www.microsoft.com/globaldev/reference/lcid-all.mspx

But I couldn't find 2048 on the list.  2058 is Spanish - Mexico.  Is that what you meant?  If there anything else with this issue?

Glad you got it working,
Dex*
0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9630472
felixyo:

Is there anything else you need on this issue?  If not, you should award the points and close out the question.

Thanks,
Dex*
0
 
LVL 19

Expert Comment

by:Dexstar
ID: 10122113
felixyo:  What's the status with this question?  Did you need anything else?

Dex*
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Kerberos / NTLM 3 64
Sharepoint Home Page (companyweb) blank 3 72
Error connecting to mysql on localhost 3 50
ASP.Net Session State alternatives 3 57
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now