Format textbox to 3 decimal point.

N

Nathan Sokalski

Take a look at the ToString() method. You will need to include a format
string as the parameter. For more information on numeric format strings,
see:

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxfund/html/6f74fd32-6c6b-48ed-8241-3c2b86dea5f4.htm
OR
http://msdn.microsoft.com/en-us/library/0c899ak8(VS.80).aspx

I believe a format string that will do what you want is "#.#00", so you
would probably do something like:

txtMyTextBox.Text=myvalue.ToString("#.#00")

Good Luck!
 
K

kimiraikkonen

How do I format the textbox to 3 decimal point all the time?

Regards,
Tee

As mentioned previously, use a masked textbox control, then in
properties windows set its Mask property to "#.#00".

HTH,

Onur Güzel
 

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