Has anyone else noticed that strings containing only numeric characters in watch nodes and data output pins show as decimal padded numbers?
I made a Python script with the output to a Watch node to sequentially generate room numbers based based on the level, and I spent a while trying to figure out why I was getting “.000” added to the end of all of my strings, and my levels prefixed with “0” were all truncated. So for instance number strings “0065” and “2023” were showing in the watch node as “65.000” and “2023.000”, but if I ran the strings through a String.Length node, they all correctly reported out as 4 characters long.
Dynamo devs, can you either change this to not screw around with string representation, or make this a togglable feature?
This is a known bug which has been addressed in a future build (2.19?). Spent 30 minutes chasing the same issue today, also in Python when processing a massive text document.
My journey consisted of me throwing multiple ‘str.replace(“.0000”,””)’ into the mix, followed by multiple “str.split(“.”)[0]” followed by joining the results and not seeing the decimals, followed by a search which found a thread showing the issue and stating it’s resolved in a future build… hopefully you lost less time than I.
Thanks Jacob!
I was using str.rjust() to get a ‘0’-padded number to use as room numbering, and I couldn’t tell if I was using the function wrong or what. Ended up writing my own function to replace .rjust(), then tried str.split(‘.’) just like you did before checking the resultant string length to understand that it was probably a bug. I might have spent 30 minutes on it, but probably didn’t cover as much ground as you did!
The output came out right, so in the end no problem, just a confusing interface issue.