clicking a numeric text field with touchscreen enabled brings up the keypad. The problem is the formatting of the float value. The formatting is set to 2 decimal places but they value in the keypad before entry is showing full precision. The tag is set to float. How can I display only two decimal places?
This isn't currently possible, but is an active bug ticket on our backlog.
The only workaround at the moment is to bring up your own numeric keypad popup window.
1 Like
ok thanks.
how im getting around it. Set the property Touchscreen Mode to None. then mouse event code below.
if system.gui.isTouchscreenModeEnabled(): #check to see if onscreen keypad is selected for use.
initialValueRaw = event.source.floatValue
formattedValue = "{:.2f}".format(initialValueRaw) #format the data to two decimal precision
enteredValue = system.gui.showNumericKeypad(float(formattedValue)) #call on screen keypad and populate operator entered data
if formattedValue != enteredValue: #check to see if the number is different (aka operator didnt push cancel)
event.source.floatValue = enteredValue
3 Likes