Solved

VB.NET number formating

Posted on 2004-08-06
7
419 Views
Last Modified: 2010-04-23
How to express the following statement in VB.NET ?

Text1.Text = format(123456789.12345,"#,###.####")

Thanks

0
Comment
Question by:vbhaha
  • 5
  • 2
7 Comments
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 11733564
Hai,

Try it like this.
MyStr = Format(5459.4, "##,##0.00")   ' Returns "5,459.40".
MyStr = Format(334.9, "###0.00")   ' Returns "334.90".
MyStr = Format(5, "0.00%")   ' Returns "500.00%".

Bye
Ajai
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 11733568
Hai,

Here it's
Text1.Text =  Format(123456789.12345, "#,##0.0000")

Bye
Ajai
0
 

Author Comment

by:vbhaha
ID: 11733638
Sorray I made a mistake, it should be:

Text1.Text = format("123456789.12345","#,###.####")
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 11

Expert Comment

by:ajaikumarr
ID: 11733652
Hai,

Here it's
Textbox1.Text = Format(cint("123456789.12345", "#,##0.0000")

Bye
Ajai
0
 
LVL 11

Accepted Solution

by:
ajaikumarr earned 125 total points
ID: 11733656
Hai,

Sorry,

TextBox1.Text = Format(CDbl("123456789.12345"), "#,##0.0000")

Bye
Ajai
0
 

Author Comment

by:vbhaha
ID: 11733674
Thanks Ajai!
0
 
LVL 11

Expert Comment

by:ajaikumarr
ID: 11733699
Hai,

Most welcome.

Bye
Ajai
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question