473,395 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

FormatCurrency

Hi,

I am trying to display a field as currency from a recordset to a text field to my asp page. I am using FormatCurrency vbscript function. Everything works as designed if the field displayed contains a number. However, if the field is null, I receive a VBScript runtime error '800a000d.

Below is the code:
Expand|Select|Wrap|Line Numbers
  1. <input name="txtLastMonthEac" type="text" id="txtLastMonthEac" value="<%= FormatCurrency((LastEacTotCapRs.Fields.Item("TotalCapEac").Value), -1, -2, -2, -2) %>" />
Below is how I am trying to avoid the error but receive a Microsoft VBScript compilation error '800a0414' Cannot use parentheses when calling a Sub
when the page opens:
Expand|Select|Wrap|Line Numbers
  1. <input name="txtLastMonthEac" type="text" id="txtLastMonthEac" value="<% If IsNumeric (LastEacTotCapRs.Fields.Item("TotalCapEac").Value) Then FormatCurrency((LastEacTotCapRs.Fields.Item("TotalCapEac").Value), -1, -2, -2, -2) End If %>" />
Am I at all close to the correct this error message? or am I way of course?

Any suggestions is appreciated. Thanks
Tom
Apr 14 '10 #1
1 2334
I found any answer on Byte. I used: FormatCurrency( "0" & (number))
Apr 15 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: eddie wang | last post by:
formatcurrency function puts ( ) for negative numbers(e.g. (111) ). How can I display the negative numbers with a minus sign infront like -111. Thanks. *** Sent via Developersdex...
1
by: Richard Davies | last post by:
Hi all I've just finished a site for a client and am just sorting out some of the finer elements of the site. The client wants prices formatted like £8 £11
3
by: Jack | last post by:
Hi, I got the following line in the formatcurrency statement that is giving error. Response.write "<TD ALIGN=RIGHT WIDTH='10%' >" & FormatCurrency(TotPersonnel) & "</TD>" & vbCRLF The error...
3
by: Tom Cahill | last post by:
The following code will work perfectly on a PC browser, IE or Netscape. However on a Mac browser (IE, Netscape, or Safari) it does not. I have tried it on OSX and OS9. ANy help anyone can offer...
3
by: jrefactors | last post by:
I want to ask what are the possiblities to truncate data from 1 million dollars to 1 dollar by using formatCurrency and CCur functions? The ASP page has code <%= formatCurrency(rs(14)) %>, the...
2
by: Andrea Williams | last post by:
Anyone have code that will format a decimal value to a string currency format for display? Something like FormatCurrency() in VBscript had? I usually search thecodeproject.com first, but...
5
by: Mark | last post by:
I have a field that has been formatted using the vb.net FormatCurrency method. Now, I need to get the amount back into a regular field so I can use it for calculations. Is there an easy way to...
5
by: ljb | last post by:
Does anyone know how to correct or why formatcurrency() places the dollar sign after the number? thanks LJB
0
by: Terje | last post by:
On my computer this code: Response.Write FormatCurrency(1000) returns kr 1?000,00 where the question mark is character code 160. What is going on here? Vista, IIS7 and Response.LCID = 1044 ...
5
by: Patrick A | last post by:
All, I'm dealing with a 3rd party application that can't interpret the Access function FormatCurrency. When it encounters my query with "Exclu: FormatCurrency(, 0)", it arfs. The vendor says...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.