Formatting Numbers

B

bole2cant

If you have code like this:

Textbox3.Text = Str(Val(Textbox1.Text) / Val(Textbox2.Text))

How do you format the result to just have one decimal place?
 
H

Herfried K. Wagner [MVP]

* "bole2cant said:
Textbox3.Text = Str(Val(Textbox1.Text) / Val(Textbox2.Text))

How do you format the result to just have one decimal place?

\\\
TextBox3.Text = (Val(TextBox1.Text) / Val(TextBox2.Text)).ToString("#.0")
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top