cancel
Showing results for 
Search instead for 
Did you mean: 

Determine if value is NaN (not a number)

matt_bostrom
New Contributor II

i’d like to be able to determine if a variable is number value or not prior to importing to a DB. i perform a parseFloat on that variable but I see it coming back as NaN and have tried multiple things to filter it out without success. does anyone know the best technique in snaplogic?

2 REPLIES 2

nganapathiraju
Former Employee

Did you look at this?

Always search snapLogic docs for help.

https://doc.snaplogic.com/wiki/spaces/SD/pages/1438183/Global+Functions+and+Properties#GlobalFunctio...

Description
Returns a string indicating the object type.
This is similar to the JavaScript typeof.
Syntax
typeof item
The possible return values are: “boolean”, “number”, “string”, “object”, and “array”.

i actually stumbled upon the isNaN function on the string methods documentation. i was looking in the numbers documentation which is why i couldnt find it. this seemed to work for me:

https://doc.snaplogic.com/wiki/spaces/SD/pages/1438183/Global+Functions+and+Properties#GlobalFunctio...