Solved

VB.NET number formating

Posted on 2004-08-06
7
432 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

680 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