Solved

FormatCurrency Issue

Posted on 2008-06-24
9
777 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
  • 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
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21863855
That is invalid html markup for £, what you need is &pound;
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now