Solved

FormatCurrency Issue

Posted on 2008-06-24
9
781 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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