473,396 Members | 1,918 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,396 software developers and data experts.

Simple formatting question...

How do I get a number like "131" to appear in a currency format like "$131.00" in a TextBox control?

I know it's simple but I cannot find how to do this in any reference manual.

TIA....
Nov 18 '05 #1
3 1107
add a maskedEdite control and set the format you want
to add this rigth clik toolbox and choose customise toolbox you will find
this control

"The Eeediot" wrote:
How do I get a number like "131" to appear in a currency format like "$131.00" in a TextBox control?

I know it's simple but I cannot find how to do this in any reference manual.

TIA...

Nov 18 '05 #2
Hmmm.

That might work if I were using Visual Studio.NET but I'm using Web Matrix.

I ended up improvising by using:

txtTotalSalesYTD.Text = "$" & String.Format("{0:F2}",
CDbl(dreader("TotalSales")))

"sara" <sa**@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
add a maskedEdite control and set the format you want
to add this rigth clik toolbox and choose customise toolbox you will find
this control

"The Eeediot" wrote:
How do I get a number like "131" to appear in a currency format like "$131.00" in a TextBox control?
I know it's simple but I cannot find how to do this in any reference manual.
TIA...

Nov 18 '05 #3
Tostring takes standard formatting, so slightly simpler:
cdbl(dreader("TotalSales")).tostring("c")

Bill

"The Eeediot" wrote:
Hmmm.

That might work if I were using Visual Studio.NET but I'm using Web Matrix.

I ended up improvising by using:

txtTotalSalesYTD.Text = "$" & String.Format("{0:F2}",
CDbl(dreader("TotalSales")))

"sara" <sa**@discussions.microsoft.com> wrote in message
news:13**********************************@microsof t.com...
add a maskedEdite control and set the format you want
to add this rigth clik toolbox and choose customise toolbox you will find
this control

"The Eeediot" wrote:
How do I get a number like "131" to appear in a currency format like "$131.00" in a TextBox control?
I know it's simple but I cannot find how to do this in any reference manual.
TIA...


Nov 18 '05 #4

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

Similar topics

7
by: Ot | last post by:
I posted this to the wrong group. It went to m.p.dotnet.languages.vb. Ooops. -------------------------------------------------------------------- I have this tiny problem. I have learned...
3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
2
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with...
15
by: Richard Hollenbeck | last post by:
For example, one college course has only 24 students in it, but the following code says there are zero As, 20 Bs, 16 Cs, 4 Ds, and 8 Fs. When it prints it then says 0 As, 40 Bs, 32 Cs, 8 Ds, and...
1
by: Chris | last post by:
Sorry to ask such a simple question but here it is, and I'm am new to ASP/WEB I am designing a site and I want to make it general so I can easily change the font/color/sizes of the...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
5
by: Burak | last post by:
Hello, I would like to format the string "11304200" into "11-3042.00". Can I do this with String.Format method? I have not come across any good documentation. Thank you,
7
by: Steven D'Aprano | last post by:
I have a sinking feeling I'm missing something really, really simple. I'm looking for a format string similar to '%.3f' except that trailing zeroes are not included. To give some examples: ...
2
by: RichB | last post by:
I am attempting to output a trace with details of the db id of a price using: Trace.WriteLine("price id(first price): {0}",evnt.Prices.Id); Wher the Id is a string. I expect from this to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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...
0
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...

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.