On Asp.Net, in my textbox, i do not want to enter after zero three 开发者_运维技巧numbers. For example if you enter textbox 0.222 it should be 0.22. After 0.22 you should not enter anything. How can i make this?
Thanks
Use a Masked TextBox.
I think it is better to use an Expression instead of Masked Textbox.
With a simple RegularExpressionValidator you are able to do this, just drag one in your worksheet and then set the TargetControl of it to your Textbox, then set its value to ^\ddd.
Using javascript add an attribute onkeyup='formatNumber(this)' on the tag.
function formatNumber(textBox) {
    var current = textBox.value;
    var output = "";
   //find '000' in current
   //delete what you want 
    textBox.value = output;
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论