How to limit the decimal place of a field?

  • Profile Image
    indoorsmanufacturing
    Asked on July 07, 2021 at 05:05 AM

    How can I have a text box field or number field to only accept inputted numbers to one decimal place before I do a calculation?

  • Profile Image
    esraari
    Answered on July 07, 2021 at 08:09 AM

    Hi,

    You can use the Input Mask feature inside of the Short Text element. The following steps may help you with this.

    Step 1: Drag and drop the Short Text element to your form

    Step 2: Click Properties

    Step 3: click OPTIONS from the opened sidebar

    Step 4: arrange your text format in the Input Mask field.

    PS: use # for masking numbers whereas @ for Letters. In your case, I believe you will only use the numbers which is #. Also, as a separator any special character you can select like comma or point.y-yOx52ZDhJm9YO934IVWfovvOe8k9rlw25O8NPi

    Let’s test it. For your use case, I preferred to use a full stop(.) as a separator and put only one hash(#) to indicate the number. Here how it works.zklA6O6J47z0e-fm2QuyOxWnR0vfNnM3GHjqAMrK

    If you require any further information, please don't hesitate to reach us!

    Thanks for using JotForm.



  • Profile Image
    indoorsmanufacturing
    Answered on July 07, 2021 at 10:23 AM

    I have the case where a user may type in numbers like the following. 2150.5 or 350.5 or 56.5 how can this be done.

    So it could be a 5 digit, 4 digit of 3 digit number which includes the full stop that may be entered by the user.

    I tried what you suggests but that only work for one situation with exact number of digits.

    is there another solution?

  • Profile Image
    Basil_A
    Answered on July 07, 2021 at 01:48 PM

    Hi,

    There isn't any other way to limit the decimal places entered in a field.

    It is possible to limit the decimal places for the data appearing on your submissions page by adding a calculation field and limiting it to one decimal place but the user will still enter as many decimals as they wish.

    1625680032_60e5e8a022da3_chrome_lpODDtAM

    1625680041_60e5e8a9ef596_chrome_lJiHve0m

    1625680079_60e5e8cf9018e_chrome_H67NvhoQ

    Please let us know if you require any further assistance.