isInteger(value, [minValue], [maxValue]) Last updated: 30. May 2026
Checks if specified value is an int.
Parameters
| Name | Type | Description |
|---|---|---|
| value | object | Value to validate. |
| minValue (optional) | number | Specify a minimum value for the number or "null" to skip. |
| maxValue (optional) | number | Specify a maximum value for the number or "null" to skip. |
Returns
Returns true if the value is an integer (within the specified range), otherwise false.
Example
Code example (JS)
JS is normal JavaScript either running in the browser or on the Docly™ server.let t = "5.5";
if (!docly.isInteger(t))
write("'" + t+ "' is not an integer \n");
let n = "123";
if (docly.isInteger(n, 100, 200))
write("123 is an integer between 100 and 200\n");
if (!docly.isInteger(n, 1, 10))
write("123 is NOT a integer between 1 and 10"); Output
The JS code above produces the output shown below:'5.5' is not an integer
123 is an integer between 100 and 200
123 is NOT a integer between 1 and 10