• Resolved kf4yfa

    (@kf4yfa)


    Hello. I’m wondering if there is a way to cause the number field to output whole numbers only? I have a question that asks about number of children. Whole numbers are wanted, not decimals, like 1.1 or 1.2. How can this be arranged for whole numbers to be the output?

    • This topic was modified 5 years, 6 months ago by kf4yfa.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hey there @kf4yfa sorry for the inconvenience on this one.

    This will be fixed in the next release of Forminator but for now, you could use the following filter to make it work with your current version:

    add_filter('forminator_field_number_markup', 'wpmudev_forminator_custom_step_field_number_markup', 10, 2);
    function wpmudev_forminator_custom_step_field_number_markup($html, $id){
        
        $html = preg_replace('/step\s*=\s*\"0.01\"/', 'step="1"', $html);
        
        return $html;
    }

    To apply this, you can do it on your theme’s functions.php file or creating a mu-plugin.

    Hope this helps, let us know if you have any further questions.

    Regards,

    Jorge.

    Thread Starter kf4yfa

    (@kf4yfa)

    I think that will work for me. When is next version expected to come out?

    Hello @kf4yfa

    Hope you are doing well!

    A new version 1.7 with the fix is released. Please update the plugin. Let us know if the issue is still there.

    Kind regards,
    Nastia

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Number Field outputting whole numbers only’ is closed to new replies.