Modulo operation

Hi,

This is an oddity but I need to validate a numeric entry in an input field using the module operator. (The module operation between two numbers returns the reminder of the division between those two numbers.)

Is there any way to do that in Wappler? Since mod is not one of the options that appears under the formatter > Operations menu, I’m going to assume that this is going to need a JS function. Trouble is, I don’t know JS.

Any suggestions / guidance will be appreciated!

You need to use the operand % for modulo in the code view.

  1. For instance in the data binding dialog, just switch from Design to Code view
  2. type in bindingvariable%60 - (replace bindingvariable with the name of the dynamic field/variable
  3. It now returns the remainder as output
    Thats it: for example, if bindingvariable is 130, bindingvariable%60 outputs 70

Excellent. Thank you. I’ll test it as soon as I have a moment.