Docly Developers
Function Updated 17 Oct 2026

isInteger(value, [minValue], [maxValue])

Checks if the value is a whole number, or text containing one ("123"). Decimals such as 5.5 or "5.5" give false, and the value must fit in a 32-bit integer. Alias: isInt.

Parameters

valueobjectrequired

Value to validate.

minValuenumberoptional

Minimum value (inclusive), or null to skip.

maxValuenumberoptional

Maximum value (inclusive), or null to skip.

Returns

Returns true if the value is an integer (within the specified range), otherwise false.

Example

Normal JavaScript, 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");