Solved

Decimal Separator problem with IIS in Windows 2000 Server .

Posted on 2003-10-24
10
1,894 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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
 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
logs for inetpub time stamps are off 1 36
SSL Certificate for IIS7 Site 2 115
Bot attack question 11 84
Finding Events logs for IIS website that restarts 2 30
Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…

732 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