# Numeric keypad ignoring float formatting

**URL:** <https://forum.inductiveautomation.com/t/numeric-keypad-ignoring-float-formatting/86023>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [February 20, 2024, 2:55pm UTC](https://forum.inductiveautomation.com/t/numeric-keypad-ignoring-float-formatting/86023 "2024-02-20T14:55:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregory\_Heinrichs](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@Gregory\_Heinrichs](https://forum.inductiveautomation.com/u/Gregory_Heinrichs)\
**Post date:** [February 20, 2024, 2:55pm UTC](https://forum.inductiveautomation.com/t/numeric-keypad-ignoring-float-formatting/86023/1 "2024-02-20T14:55:54Z")

</div>

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?

 ![ignition-keypad-float](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/5/e5bea878078c5f2e7f7ec57fef7392d2824f9c8d.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 20, 2024, 3:57pm UTC](https://forum.inductiveautomation.com/t/numeric-keypad-ignoring-float-formatting/86023/2 "2024-02-20T15:57:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gregory\_Heinrichs](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@Gregory\_Heinrichs](https://forum.inductiveautomation.com/u/Gregory_Heinrichs)\
**Post date:** [February 20, 2024, 6:29pm UTC](https://forum.inductiveautomation.com/t/numeric-keypad-ignoring-float-formatting/86023/3 "2024-02-20T18:29:34Z")

</div>

ok thanks.

---

<div class="post-metadata">

**Author:** ![Gregory\_Heinrichs](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@Gregory\_Heinrichs](https://forum.inductiveautomation.com/u/Gregory_Heinrichs)\
**Post date:** [February 21, 2024, 2:23pm UTC](https://forum.inductiveautomation.com/t/numeric-keypad-ignoring-float-formatting/86023/4 "2024-02-21T14:23:28Z")

</div>

how im getting around it. Set the property Touchscreen Mode to None. then mouse event code below.

```auto
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

```
