?
Solved

Decimal Separator problem with IIS in Windows 2000 Server .

Posted on 2003-10-24
10
Medium Priority
?
1,919 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

752 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