Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FormatCurrency Issue

Posted on 2008-06-24
9
Medium Priority
?
786 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
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 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 750 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 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