Renumber elements "Mark" by Level in integer

Hi all,

I’m trying to renumber elements “Mark” by level in dynamo using resources in internet, and I can renumber the “Mark” using this script:

But why is the result are in number not integer?

because I think I already use integer for all input.

You’re turning the value into a string… which adds the trailing zero’es…

image

Hi @Jonathan.Olesen,

Thank you for your reply, but if I remove this node, it will make all “null”

I did not say it was wrong just that turning a integer into a string will, using the ootb node return trailing zeroes… If you want to remove them you can simply chop them from the string prior to passing the string to the values input :slight_smile:

I personally like using a codeblock to turn into string as this does not add trailing zeroes :slight_smile:


(Unless it is in fact a double you have to begin with (e.g 1.0, 2.0 etc).

In that case I would do like so:

1 Like

Hi @Jonathan.Olesen,

You are amazing! I learnt something from you to use CodeBlock & String.Remove
Problem Solved!