Solved

Decimal Separator problem with IIS in Windows 2000 Server .

Posted on 2003-10-24
10
1,844 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 19

Accepted Solution

by:
Dexstar earned 300 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
felixyo:  What's the status with this question?  Did you need anything else?

Dex*
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

16 Experts available now in Live!

Get 1:1 Help Now