473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Session.LCID & FormatNumber


I'm doing some tests to see if the Session.LCID can be used to easily change
a user-dependant locale for number & date/time formatting in ASP. As far as
I get the theory this should work, but I'm concerded that there might be
some issues when serverside regional settings are changed.

I'm having this one case where I'm having something odd already.
This is my testcode:

<%
session.lcid = 2067 ' nl-be

Dim Num
Num = 0.5

response.write formatnumber(Num, 2) & "<br>"
response.write formatcurrency(Num) & "<br>"
response.write Num & "<br>"
%>

The result I get is:

0.50
? 0.50
0,5

Question:
Why is a dot used as the decimal seperator in the first 2 cases, while a
comma is used in the last?
Even if changes have been made to regional settings (setting default use of
comma in Belgium to a dot), shouldn't those be used in ALL cases?


Jul 19 '05 #1
6 8521
"J. Baute" <WU**********@spammotel.com> wrote in message
news:40*********************@news.skynet.be...

I'm doing some tests to see if the Session.LCID can be used to easily change a user-dependant locale for number & date/time formatting in ASP. As far as I get the theory this should work, but I'm concerded that there might be
some issues when serverside regional settings are changed.

I'm having this one case where I'm having something odd already.
This is my testcode:

bonjour J. Baute

Try
SetLocale "nl-be"
and also be sure that the character set is send to the client. This is
normally ISO...
Response.CharSet = "windows-1252"

The windows characterset has the euro symbol...
<%
session.lcid = 2067 ' nl-be

Dim Num
Num = 0.5

response.write formatnumber(Num, 2) & "<br>"
response.write formatcurrency(Num) & "<br>"
response.write Num & "<br>"
%>

The result I get is:

0.50
? 0.50
0,5

Question:
Why is a dot used as the decimal seperator in the first 2 cases, while a
comma is used in the last?
Even if changes have been made to regional settings (setting default use of comma in Belgium to a dot), shouldn't those be used in ALL cases?


Jul 19 '05 #2

"Egbert Nierop (MVP for IIS)" <eg***********@nospam.com> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
"J. Baute" <WU**********@spammotel.com> wrote in message
news:40*********************@news.skynet.be...

I'm doing some tests to see if the Session.LCID can be used to easily change
a user-dependant locale for number & date/time formatting in ASP. As

far as
I get the theory this should work, but I'm concerded that there might be
some issues when serverside regional settings are changed.

I'm having this one case where I'm having something odd already.
This is my testcode:

bonjour J. Baute

Try
SetLocale "nl-be"
and also be sure that the character set is send to the client. This is
normally ISO...
Response.CharSet = "windows-1252"

The windows characterset has the euro symbol...


hmmm, I didn't notice that euro symbol got lost in the usenet post, it did
show up as expected on my system though, so no issues there :)

it turns out that the HKUsers\.default\Control Panel\International settings
had been changed manually in the past,
and since the system is initially installed with nl-be regional settings,
this seems to be causing the abnormal decimal point behaviour when using
that specific locale,
makes sense I guess

thanx anyway
J.
Jul 19 '05 #3
"J. Baute" <WU**********@spammotel.com> wrote in message
news:40**********************@news.skynet.be...

"Egbert Nierop (MVP for IIS)" <eg***********@nospam.com> wrote in message
news:OY**************@TK2MSFTNGP09.phx.gbl...
"J. Baute" <WU**********@spammotel.com> wrote in message
news:40*********************@news.skynet.be...

I'm doing some tests to see if the Session.LCID can be used to easily change
a user-dependant locale for number & date/time formatting in ASP. As

far
as
I get the theory this should work, but I'm concerded that there might be some issues when serverside regional settings are changed.

I'm having this one case where I'm having something odd already.
This is my testcode:

bonjour J. Baute

Try
SetLocale "nl-be"
and also be sure that the character set is send to the client. This is
normally ISO...
Response.CharSet = "windows-1252"

The windows characterset has the euro symbol...


hmmm, I didn't notice that euro symbol got lost in the usenet post, it did
show up as expected on my system though, so no issues there :)

it turns out that the HKUsers\.default\Control Panel\International

settings had been changed manually in the past,
and since the system is initially installed with nl-be regional settings,
this seems to be causing the abnormal decimal point behaviour when using
that specific locale,
makes sense I guess
Still, it's abug. I believe not all vbscript engines have that behaviour.
Vbscript should behave like Session.LCID is configured.
thanx anyway
J.


Jul 19 '05 #4
Still, it's abug. I believe not all vbscript engines have that behaviour.
Vbscript should behave like Session.LCID is configured.


I've been doing some more testing, by looping through all possible LCID
values with SetLocale, and comparing the result from a CStr() &
FormatNumber(), which should always be equal, and list those cases where
this is not the case.

Currently on one system (the one where the settings have been manually
changed in the registry) I'm getting differences on locales 1033 (en-us) and
1024.
I can't find what locale 1024 is in the LCID list on MSDN though, does
anyone know what this value is used for?

thx,
J.
Jul 19 '05 #5
Please, how to formating number in indian format as 23,32,444 in asp&vbscript
May 5 '06 #6
formating number in formatnumber function do'nt solve problem
May 5 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Claudio Cezar | last post by:
I live in Brazil and i am trying to set my application to work with american date format. The problem is, even when i set the LCID property at the beginning of my code, it always returns the...
5
by: b_boy | last post by:
Hi all, I recently downloaded a calendar that i am trying out for a client. It works fine when i test it on my machine..however when i test it on the hosts server it can't handle the date format....
2
by: grw | last post by:
Trying to locate the list of valid lcid's on MS's site and googled. Ive toiled long and hard, but alas I cannot locate the information. (previous links moved) Could anyone point me in the...
0
by: David Patow | last post by:
Can anyone explain why neither ASP Session.LCID nor VBScript SetLocale() effect the locale of a VB6-based COM object that is instantiated via Server.CreateObject()? If I set Session.LCID, then...
0
by: Darren | last post by:
I used the following code on a server; <% ReturnDateTime 1033, "English (US)" ReturnDateTime 2057, "English (UK)" ReturnDateTime 3081, "English (Australia)" ReturnDateTime 1031, "German" ...
8
by: Rob | last post by:
Hi all, Is it possible to change the Session.LCID in a hyperlink? My problem is I'm calling a Date from a database to use as a querystring in the hyperlink but I also need to display the date as...
1
by: Hagge | last post by:
We are translating our web shop to Slovak but when I use Session.LCID=1051 for slovak do I get the error "Invalid LCID". The same shope use Swedish = 1053, Norwegian(Bokmal) = 1044, English = 1033...
0
by: ubi_comp | last post by:
Hi, I have a windows 2003 server IIS6 machine in development environment. I set Session.Lcid in aspx Page1 and move to aspx Page2 and use Session.Lcid value that I set in the Page1 without...
0
by: Just4U | last post by:
Hello, My config : Windows 2003 x64 (US VERSION) + sp2, IIS 6 All regional settings to French (even for default user) In my ASP pages dates are in the good format (french:dd/mm/yyyy), but...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.