473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FormatCurrency

9 New Member
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 2358
r90slash6
9 New Member
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
2615
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 http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
1
1373
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
5109
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 message is: Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'formatcurrency' /gwisprod/FSR_EditDetailPrint.asp, line 345
3
2849
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 would be appreciated. Thank you. function calc() { var event1_discount_name = ""; //name of discount to be incorporated into PayPal description var event2_discount_name = "";
3
2254
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 database rs(14) is 100000000. But when it displays it in the screen, it shows $1.00 with code <%= formatCurrency(rs(14)) %> There is another place with code using CCur and formatCurrency together, i am not sure if this is ok.
2
10965
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 something's wrong b/c I can't get to the articles where there might be an answer. Thanks in advance, Andrea
5
21860
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 remove the formatting characters ($,) ? I suppose I could always use the replace function to remove the $ and comma, but I wasn't sure if there was any easier way, i.e. Format(...) TIA, Mark
5
1656
by: ljb | last post by:
Does anyone know how to correct or why formatcurrency() places the dollar sign after the number? thanks LJB
0
1507
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 terje
5
2052
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 I have to use "straight SQL." Can someone point me to a good SQL reference where I can find the SQL eqiuvalent, assuming there is one?
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.