Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Text Box decimals

Status
Not open for further replies.

ChechiCR

Structural
Joined
Jun 29, 2010
Messages
2
Location
CR
Could someone tell me how to change the number of decimals to use on mathcad´s control textbox, when I am using a input variable. Maybe using Edit Script? Thanks.

Sergio
 
Code:
Sub TextBoxEvent_Start()
  Rem TODO: Add your code here
End Sub

Sub TextBoxEvent_Exec(Inputs,Outputs)
	Value = CDbl(TextBox.Text)
	IntVal = Int(Value)
	Str = Len(IntVal)
	Txt = Left(TextBox.Text,Str+3)
	Outputs(0).Value = CDbl(Txt)
End Sub

Sub TextBoxEvent_Stop()
  Rem TODO: Add your code here
End Sub

I think, this is what you want. Of course, you'll have to change the "+3" to something else. This gives you only two digits after the decimal point.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top