Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello...
I want to create a masked text box that accepts ##.#### value.
But how to append a "0" to that masked text box at position 0#.#### ?

e.g. : if i entered 2.9869 it should to display to 02.9869...
(i tried that but the that masked textbox returns me double value so if i set that returned value to masked textbox again then it neglects the .(dot) and sets the text value to 28.86)

Please help me...i m using Visual Basic 2008
You can send the code snippets...
Posted
Updated 11-Aug-11 21:45pm
v2

1 solution

pre>Hi,

You may use ToString
Example code::

Dim acctHashTotal As Decimal = 2.9869
Me.txtAcctHashTotal.Text = acctHashTotal.ToString("0#.0000");


Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Regards,

Algem
 
Share this answer
 
v2
Comments
KPRANAV_Dot_Net 12-Aug-11 5:12am    
Thanks for your solution, its working for me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900