Contact Us 1-800-596-4880

isInteger

isInteger(number: Number): Boolean

Returns true if the given number is an integer (which lacks decimals), false if not.

Parameters

Name Description

number

The number to evaluate.

Example

This example indicates whether the input is an integer for different values. Note numbers within strings get coerced to numbers.

Source

%dw 2.0
output application/json
---
[isInteger(1), isInteger(2.0), isInteger(2.2), isInteger("1")]

Output

[ true, true, false, true ]