Solved

VB.NET number formating

Posted on 2004-08-06
7
404 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now