GF_Field_Number automatically rounding floats to 4 places?

Hello all,

In developing a site that makes heavy use of Gravity Forms, I’ve noticed a behavior that is causing me some issues and I’m wondering if there is a way to modify or disable it; I cannot seem to find a relevant filter or action to hook into in the documentation.

I have a couple Number fields on a form that do not have calculations enabled. Due to the needs of the information being collected, we need to be able to accept a decimal value with 5 or 6 places past the decimal point (a number like “21.62014”). However, it appears that somewhere in the submission process, these values are being automatically rounded to 4 places (“21.6201”). I see that it is possible to affect the rounding precision of Number fields that do have calculation enabled, but that the maximum precision is 4 places; that coincidence makes me wonder if it’s related. Debugging through hooking into each filter along the process seems to indicate it is occurring sometime between gform_trim_input_value and gform_save_field_value (by the time it goes to save the field value out to an entry the GF_Field object’s defaultValue has already been rounded.)

So, the short version: is it possible to disable or override whatever is forcing this arbitrary precision on Number fields that do not have calculation enabled? Or is our only option to change these to a text entry field and convert them back into floats on the back-end? Thank you so much!

I created a form with a number field and it does not round anything when I submit the form. Please give it a test here.

[SITE REMOVED]

You will see the number you submitted (or a rounded number) on the confirmation page.)

Interesting, this is occurring on a bone stock installation of Gravity Forms on latest WP for me. Perhaps it’s a platform issue instead … thank you, it appears I’m barking up the wrong tree.

If you want to export the form and send it to me via email chris@rocketgenius.com, I can take a look and make sure it’s not something different in your form that’s doing it.