It depends on what you want to do.
- do you want do display a variable like x=54.124678 but roundet with 3 digits after the decimal point ?
This is the case of both suggested solutions.
Ex. TextBox1.Text=Round(x,3)
- do you want to allocate the value in the TextBox to a variable but rounded ?
Ex. x=Round(TextBox1.Text,3)
- do you want the variable in the Textbox rounded during input ?
This would be somewhat more complicated, but you can use the Door library
and look at agrahams example of Uppercase in textbox or the livefilter example and adpt it to your requirement.
You will find this in:
http://www.b4x.com/forum/showthread.php?t=2183
Best regards