473,788 Members | 2,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Format output to currency



In my response.write line, I need to format a field to be a currency
value. Is there a quick and dirty way to do it or is it an involved
edit? Here is my code:

Response.Write( "<td>" & WhataRecordset. Fields.Item(0). Value &
"</td><td>" & WhataRecordset. Fields.Item(1). Value & _
"</td><td>" & WhataRecordset. Fields.Item(2). Value & "</td><td>" &
WhataRecordset. Fields.Item(3). Value & _
"</td><td>" & WhataRecordset. Fields.Item(4). Value & "</td><td>" &
WhataRecordset. Fields.Item(5). Value & _
"</td><td>" & WhataRecordset. Fields.Item(6). Value & "</td></tr>")

The value written out in WhataRecordset. Fields.Item(2) is a monetary
amount and should be formatted in the currency format.

Thanks in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
2 2300
Yes, have you tried the FormatCurrency( ) function? ;-)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Micromanag ed" <no*****@nospam .org> wrote in message
news:e5******** ******@TK2MSFTN GP10.phx.gbl...


In my response.write line, I need to format a field to be a currency
value. Is there a quick and dirty way to do it or is it an involved
edit? Here is my code:

Response.Write( "<td>" & WhataRecordset. Fields.Item(0). Value &
"</td><td>" & WhataRecordset. Fields.Item(1). Value & _
"</td><td>" & WhataRecordset. Fields.Item(2). Value & "</td><td>" &
WhataRecordset. Fields.Item(3). Value & _
"</td><td>" & WhataRecordset. Fields.Item(4). Value & "</td><td>" &
WhataRecordset. Fields.Item(5). Value & _
"</td><td>" & WhataRecordset. Fields.Item(6). Value & "</td></tr>")

The value written out in WhataRecordset. Fields.Item(2) is a monetary
amount and should be formatted in the currency format.

Thanks in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2


It just barely dawned on me stupid brain after I posted the question.
Long day and it is only half over.

Thanks, though.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8867
by: Bill Stanard | last post by:
I have had no success using the format function as follows (the two lines of code run one after the other): 'displays a running total of lblAmtdue.Caption 'contents in txtTotal.Text txtTotal.Text = lblAmtdue.Caption + Val(txtTotal.Text) 'tries to format contents of txtTotal.Text as currency; doesn't work txtTotal.Text = Format$(txtTotal.Text, "Currency")
2
9614
by: Dalan | last post by:
This should not be an issue, but it is. I'm sure that someone knows what little piece of code is needed too persuade Access 97 to include a currency format for labels (Avery, mailing type). Have had no problems with currency formatting on reports - just the labels. Doesn't matter if the associated field in the Table and Form have Format as Currency, because on the labels (for instance $50.00) prints as: 50 The only way to get it to print...
2
4558
by: Bob Dydd | last post by:
Hi Everbody Question Changing the regional settings ie. from UK to US AUS etc, Access retains the original currency format that the application was created in. So if an mdb that is written on a computer with Regional Settings Currency Format set to UK £'s , when that mdb is open on a machine
4
22602
by: Gerry Abbott | last post by:
Hi All. How can i put a zero decimal for my currency into my format statement, == & ", for " & & " days. Cost " & Format(,"Currency") which is the data source for a textbox on a report
1
2316
by: J.B | last post by:
I have a datagrid that will display different datasets, (it runs different sprocs based on a value in the querystring) but it will always return 6 columns. The 5th and 6th columns are always Date and Currency format, all others are strings. I'd like to build one datagrid to handle this datagrid dynamically. I have it working now, all except the formatting of the 5th (Date) and 6th (Currency) columns. Since the headers for those...
1
2019
by: D. Shane Fowlkes | last post by:
I have a DataItem in a Template that calls a Function to perform a calculation. The Function returns a decimal value. Easy enough. It looks like this: <code> <%# CalculateExpended(Container.DataItem("StaffID")) %> </code> So how exactly can I format this to come out as currency? I can NOT format the output in the function. The function must return a decimal. I've tried
2
3837
by: | last post by:
Hi all, I need to format screen output for a textbox that's bound to a datasource. I know how to format the data in a plain old string, but in this case I'm not sure where to "sneak" in there to do the formatting. For example, textbox txtAcctBalance is bound to a currency field in my dataset, and when the value shows up on the screen I want it formatted as currency ("C").
1
3909
by: Andy | last post by:
Hi there, I have an asp.net 2 application, and created a local report using MS ReportViewer. The report consists of a line chart, with date intervals on the x axis, and amounts of money in the y axis. It all works fine, but the amounts of money are high (in millions), and so the y axis shows increments of 10000000 and has amounts showing on the grid lines of 10000000, 20000000, 30000000, 40000000 etc. I would like to format these to a...
2
2147
by: Dhananjay | last post by:
Hi all , I have got problem when i am tring to exportGridview Data into Excel format. It is going into text format ,but what i want is if the field is number/currency then it should go into number/currency format itself .Data exported to excel are all exported as text. Export to excel should maintain the formatting like numbers and money should be numbers and money in excel .
0
10366
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
10175
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
10112
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7518
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
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
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
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3675
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.