Solved

Decimal Separator problem with IIS in Windows 2000 Server .

Posted on 2003-10-24
10
1,900 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
Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

 
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

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

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

Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

691 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