Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format a string

Status
Not open for further replies.

ldejesuspr

Programmer
Jul 29, 2004
27
PR
Hello,

I would like to format a string in a floating point format type. Like 999.99 For instance, if the string is:

1 = 1.00
1.0 = 1.00
1.1 = 1.10

Could someone teach me how to accomplish this?

thanks in advance

 
Use:
Code:
Format(1.1,"##0.00")[\code]

Senior Software Developer
[URL unfurl="true"]http://www.scoutsft.com[/URL]
 
Try the following:

Code:
    Dim d As Double = 12345.1
    Dim s As String = d.ToString("0.00")
    MessageBox.Show(s)


Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top