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

Home Posts Topics Members FAQ

FormatCurrency or equiv

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
Nov 16 '05 #1
2 10964
Hello

decimal c = 10;
Console.WriteLi ne(c.ToString(" C"));

Best regards,
Sherif

"Andrea Williams" <an*******@hotm ail.IHATESpam.c om> wrote in message
news:#j******** *****@TK2MSFTNG P11.phx.gbl...
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

Nov 16 '05 #2
I was going to write that I found it but you beat me to it.

THANKS!

Andrea

"Sherif ElMetainy" <el************ *@wayout.net.NO SPAM> wrote in message
news:uV******** ******@TK2MSFTN GP11.phx.gbl...
Hello

decimal c = 10;
Console.WriteLi ne(c.ToString(" C"));

Best regards,
Sherif

"Andrea Williams" <an*******@hotm ail.IHATESpam.c om> wrote in message
news:#j******** *****@TK2MSFTNG P11.phx.gbl...
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


Nov 16 '05 #3

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

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!
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
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
1428
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?
1
2358
by: r90slash6 | last post by:
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: <input name="txtLastMonthEac" type="text" id="txtLastMonthEac" value="<%=...
0
8413
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
8842
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
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
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
5642
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
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
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
1733
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.