Solved

FormatCurrency Issue

Posted on 2008-06-24
9
785 Views
Last Modified: 2012-08-13
Hi all

When I use FormatCurrency(1.00) in ASP I get £1.00.  Anybody got any clues?
<% @ LANGUAGE="VBScript" %>
<% 
Dim strCurrencyTest
	
	Session.LCID = 2057
	strCurrencyTest = FormatCurrency(1.00)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> 
	<title>Currency Test</title>
</head> 
<body>
	<form>
	<table>
		<tr>
			<td><%=strCurrencyTest%></td>
		</tr>
	</table>
	</form>
</body>
</html

Open in new window

0
Comment
Question by:OxonDev
[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
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 22

Expert Comment

by:neeraj523
ID: 21863165
can you check the output using

Session.LCID = 1033


0
 
LVL 2

Expert Comment

by:Deepika_Rastogi
ID: 21863239
You can use the VBScript SetLocale function in conjunction with FormatCurrency to change the currency symbol displayed.

SetLocale(LCID)

You can use the Decimal, Hex, or Short String value for the LCID (Locale ID), for example these will all set the Locale to English - United States:

SetLocale("en-us")   :    SetLocale(0x0409 )    :    SetLocale(2057)

Also visit
http://msdn.microsoft.com/en-us/library/5xf99h19(VS.85).aspx
for further assistance
http://msdn.microsoft.com/en-us/library/0h88fahh(VS.85).aspx
to view the locale id chart


0
 
LVL 2

Expert Comment

by:Deepika_Rastogi
ID: 21863270
Also

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 = 1033
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 = 1033%>
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 10

Expert Comment

by:bluefezteam
ID: 21863855
That is invalid html markup for £, what you need is &pound;
0
 
LVL 10

Accepted Solution

by:
bluefezteam earned 250 total points
ID: 21863858
just use this

<%
response.write("&pound;" & formatNumber("2",2))
%>
0
 
LVL 5

Expert Comment

by:Abiel de Groot
ID: 21866726
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

Sets the character encoding UFT8

Regards

A.
0
 
LVL 5

Expert Comment

by:Abiel de Groot
ID: 21866742
Also...

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

A.
0
 
LVL 6

Author Comment

by:OxonDev
ID: 21869922
Thanks all for your efforts but bluefezteam was the only one to find a work around for the problem so...  It would still be nice to know what causes it in the first place but I settle for a fix!
0
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21874101
glad to be of help

cheers
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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 recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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