?
Solved

Cannot get a uk pound sign displayed no matter how I play with locales

Posted on 2003-03-21
9
Medium Priority
?
2,095 Views
Last Modified: 2007-12-19
On Windows2000 server I with the locale set to English (United Kingdom) I have the following code:

%
session.lcid = 2048
response.write "locale : " & session.lcid
response.write formatCurrency(99.99, 2, -2, -2, -2)

session.lcid = 2057
response.write "locale : " & session.lcid
response.write formatCurrency(99.99, 2, -2, -2, -1)

session.lcid = 1033
response.write "locale : " & session.lcid
response.write formatCurrency(99.99, 2, -2, -2, -2)

session.lcid = 1043
response.write "locale : " & session.lcid
response.write formatCurrency(99.99, 2, -2, -2, -2)

session.lcid = 1034
response.write "locale : " & session.lcid
response.write formatCurrency(99.99, 2, -2, -2, -2)
%>

Which gives this output:

locale : 2048
$99.99

locale : 2057
$99.99

locale : 1033
$99.99

locale : 1043
fl 99,99

locale : 1034
99,99 pta

I cannot get the pound sign displayed to the uk locale. I all options for the last parameter of formatCurrency [-2, -1, 0].

Help!
0
Comment
Question by:chamandrew
[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
9 Comments
 

Expert Comment

by:xanderd
ID: 8181602
I had the same problem, so i took the easy option:!

Remove the formatCurrency command and simply write in your own symbol such as:

response.write £(99.99, 2, -2, -2, -2).

If you want an adaptive symbol depending on local, then you could do (sorry its in javascript):

var CurrencySymbol
if (local==x) {CurrencySymbol='£'} else if(local==y){CurrencySymbol='pts'}else CurrencySymbol='$'

Response.Write(CurrencySymbol)...

where x, y are the locals.

Hope this helps...!
0
 

Expert Comment

by:xanderd
ID: 8181631
the hash was a british pound sign, but it was removed for some reason!!
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 8183019
>>the hash was a british pound sign, but it was removed for some reason!! <<
Obviously EE has the same problem that the questioner is asking about.

Anthony
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Expert Comment

by:ActiveMedia
ID: 8184529
@

I copied your LCID code to my IIS localhost running under XP, and got pound sign and others.

The ability of any server to handle LCID correctly is limited to which LCIDs are installed on the server.  Most server installations only have a limited set, so you should check which are available by default and which need adding for the locale that you need.

I notice in using your code that 1043 produced "fl" and 1034 produced "pts".

This indicates that perhaps your server is not up to date as they should be displaying the Euro symbol now that most of the EU countries (excluding UK and one or two other slowbies) have adopted the single currency and Microsoft has got round to updating their LCID information.

Note however that even with the Euro in use, you should still aim to use the specific country LCID as the POSITION of the currency symbol is different in different countries, e.g.:

locale : 1043   € 99,99

locale : 1034   99,99 €

What puzzled me was that when I used your code on my system, locale id 2048 was replaced by 1033.  

If you want the British pound sign in HTML, use &pound;

HTH

@
0
 
LVL 2

Expert Comment

by:ActiveMedia
ID: 8184578
@

chamandrew

I checked on MSDN and cannot find an LCID of 2048.

What locale/country do you intend?

@
0
 
LVL 2

Accepted Solution

by:
ActiveMedia earned 300 total points
ID: 8184600
Hey Experts Exchange, what's happening to the display?

My earlier post about the POSITION of the currency symbol in different locales, included the Euro symbol but EE has excluded it.  

locale : 1043    &euro; 99,99

locale : 1034   99,99 &euro;


The HTML code for the Euro currency symbol is:  &euro;

0
 
LVL 2

Expert Comment

by:ActiveMedia
ID: 8184882
@

Have you checked that sessions are enabled?

Quote from MSDN:
Setting Response.LCID explicitly affects a single page, whereas setting Session.LCID affects all responses in a session.

If Response.LCID is not explicitly set on a page, it is implicitly set by Session.LCID, if sessions are enabled.

If sessions are not enabled, Response.LCID is set by @LCID, if @LCID is present on the page. If there is no @LCID on the page, Response.LCID is set by the AspLCID metabase property. If the AspLCID property is not set, or set to 0, Response.LCID is set by the default system locale.
Quote ends

@

0
 

Expert Comment

by:xanderd
ID: 8194434
You can also try this:

If you can run a global.asa file on your server then place the following into your global.asa file to change the locale settings throughout your site: -

'When a session starts on the server the following code will be run
Sub Session_OnStart

     'Set the server locale
     Session.LCID = 2057

End Sub

If you can not use a global.asa file, place following into the top of each ASP page you wish to change the locale settings on: -

<%
'Set the server locale
Session.LCID = 2057
%>  
 
The LCID number above, 2057, will set the locale settings on the server to United Kingdom English, which will accordingly alter the currency and date formats.

-Alex
 
0
 
LVL 58

Expert Comment

by:Gary
ID: 9313388
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by ActiveMedia

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

762 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