# Rounding Float for Display While Preserving Original Value to be saved into DB table

**URL:** <https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 1, 2025, 2:19pm UTC](https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523 "2025-04-01T14:19:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![julio\_Bautista](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@julio\_Bautista](https://forum.inductiveautomation.com/u/julio_Bautista)\
**Post date:** [April 1, 2025, 2:19pm UTC](https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523/1 "2025-04-01T14:19:19Z")

</div>

I have a client who wants to enter a float value, round it to a whole number for display purposes, but still save the original float value to the database. How can I achieve this, since changing the format or number type of the component removes the decimal values from the float property?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 1, 2025, 2:23pm UTC](https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523/2 "2025-04-01T14:23:10Z")

</div>

Please add the 'vision' or 'perspective' tag to your question title. The answer depends on that information.

---

<div class="post-metadata">

**Author:** ![Jesse\_Dale\_Gimenez](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jesse_dale_gimenez/32/68763_2.png) [@Jesse\_Dale\_Gimenez](https://forum.inductiveautomation.com/u/Jesse_Dale_Gimenez)\
**Post date:** [April 3, 2025, 7:30am UTC](https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523/3 "2025-04-03T07:30:18Z")

</div>

![solve 2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/6/b6f2a0b679f05ca1f5b48619f6b5290a8be460e4.jpeg)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 3, 2025, 12:03pm UTC](https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523/4 "2025-04-03T12:03:32Z")

</div>

1. Don't use a text field for numbers. Use a numeric field and its formatting feature.

2. Don't use transforms on entry field's value bindings--that breaks bidirectionality.

---

<div class="post-metadata">

**Author:** ![julio\_Bautista](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@julio\_Bautista](https://forum.inductiveautomation.com/u/julio_Bautista)\
**Post date:** [April 3, 2025, 12:51pm UTC](https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523/5 "2025-04-03T12:51:09Z")

</div>

Understood, but using the formatting feature truncates the decimal in the float value property which I'll need to save it onto the database.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 3, 2025, 1:30pm UTC](https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523/6 "2025-04-03T13:30:07Z")

</div>

Then use a numeric entry field without formatting to enter the value with full precision, and display the value formatted with a label and a `numberFormat()` expression binding. If you cannot meet both requirements in a single component, then don't use a single component.

---

<div class="post-metadata">

**Author:** ![Jesse\_Dale\_Gimenez](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jesse_dale_gimenez/32/68763_2.png) [@Jesse\_Dale\_Gimenez](https://forum.inductiveautomation.com/u/Jesse_Dale_Gimenez)\
**Post date:** [April 4, 2025, 5:38am UTC](https://forum.inductiveautomation.com/t/rounding-float-for-display-while-preserving-original-value-to-be-saved-into-db-table/104523/7 "2025-04-04T05:38:47Z")

</div>

Noted on this
