Jump to content

Format codes for special handling of NaN?


David Boyd

Recommended Posts

Hello all-

Was having this discussion with my coworker today, and he swears he saw a clever example of this somewhere - the task at hand is to convert doubles to strings for eventual display in a table. I regularly use NaN to indicate lack of a measured value, and I was lamenting all the extra nodes it takes, to test for isNaN?, then a select node, and an empty string constant, just to suppress the 'NaN' text, which is meaningless to my end users. Plus, while I want to format multiple doubles into a row of the table, I can't use an expandable Format Into String node if I need to do this testing and selecting.

So, is there some undocumented format code to conditionally format an NaN? Or is he confusing this with Excel's conditional formatting?

Best regards,

Dave

post-195-1158118907.png?width=400

Link to comment
Why not use the Search and Replace?

(Insert head-smack noise here.) Doh!

Michael, sometimes the obvious solution just doesn't occur to me... This method looks to be clean and 100% reliable - after all, NaN always gets converted to the string "NaN", so it's a cinch to do the fixup in the string.

Thanks a bunch!

Dave

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.