Hi Andrew,
The check for string-length is to compare it to 0 - the string-length function will return 0 for null or NaN values.
string-length(${QUANTITY1}) > 0
is true for non-NaN or null values, false otherwise.
The discussion on NaN/null you cite concerns understanding how those values affect calculations in other questions, not how to test for NaN/null.