Solved

VB.NET number formating

Posted on 2004-08-06
7
392 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

759 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

20 Experts available now in Live!

Get 1:1 Help Now