• Resolved larido55

    (@larido55)


    Hi

    Is it possible to allow user to input only values rounded to 0.5? (i.e 122.5, 133.0, 1.5) – but no other values with accuracy 0.1 such us 122.4, 133.9, 1.3 ?

    Best Regards
    Larido

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Altos

    (@sefin)

    Hello,

    You can do it following this post, otherwise It’ necessary you buy the PRO version here

    Let us know id this solved your problem or not.

    Best Regards

    Plugin Author Altos

    (@sefin)

    Reading more accurately your question.
    I think you need our regex function.
    You can create regex rule to validate your field and allow only values that ends in .0 or .5
    You can try on our demo site

    Best Regards

    Thread Starter larido55

    (@larido55)

    Thank you for feedback and directing me to regex rules.

    However regex rule I can apply only to text field.

    Unfortunately my current fields were I need rounding is numeric (numeric fields give me possibility to define minimum and maximum value).

    Is any way to apply solution for rounding if the field type is numeric (not text)?

    example for 122:
    122.0 -> 122.0
    122.1 -> 122.0
    122.2 -> 122.0
    122.3 -> 122.5
    122.4 -> 122.5
    122.5 -> 122.5
    122.6 -> 122.5
    122.7 -> 122.5
    122.8 -> 123.0
    122.9 -> 123.0

    Best Regards

    Plugin Author Altos

    (@sefin)

    Hi!

    Can you check if this code Regex works?
    /^[0-9]+\.[0|5]$/

    You can test it with the text field.

    If it works, We can fix the PRO version to make it works with numeric fields also.

    I hope that can help you.

    Best Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Rounding of numerical values to 0.5’ is closed to new replies.