Docly Developers
Function Updated 17 Oct 2026

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

Checks if the value is a number or numeric text. Text may use a comma as decimal separator and spaces as thousands separators ("1 234,5" is a number). null gives false, and note that true and false count as numbers (1 and 0). Alias: isNum.

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 value is a number (within the specified range).

Example

Normal JavaScript, running in the browser or on the Docly™ server.
let t = "test";

if (!docly.isNumber(t))
    write("'test' is not a number \n");

let n = 123;
if (docly.isNumber(n, 100, 200))
    write("123 is a number between 100 and 200\n");
    
if (!docly.isNumber(n, 1, 10))
    write("123 is NOT a number between 1 and 10");