Any way to concatenate numbers without adding a lot of zero's?

Hi everyone,

I am looking for a way to concatenate numbers as a string, so they can be pushed back to a Revit family parameter. However, when these values become a string from object, a lot of zeros are added. I would like to have it without zero’s, so I would only like to keep the 3075 and 800. Is that somehow possible?

Thanks in advance!!!

Hi,

I think this python script from @christian.stan can help you a lot.

1 Like

Looks good, thanks. Is there any way to remove any number after the komma? My output is still 400.0, where 400 should be correct?

Hi try string split “,” as seperator and take first item another way could be a mathceiling or floor before string from object in this case

Do you mean like this?

Just mean something here…

1 Like

@sovitek’s example with Math.Floor is the easiest solution. The “issue” comes from the numbers being formatted as doubles. Converting them to integers before stringifying them leaves out the trailing zeros.

2 Likes

This works indeed, thanks alot

2 Likes