Convert negative values to 0

Hallo Dear community,

is there a way in GH, to convert the all negatives values from a list to 0?

Thanks in advance

image

3 Likes

Thanks a lot

Another workaround

2 Likes

rgm

7 Likes

Why this error?

That component might not carry out auto-magickal type conversion from strings to numbers. Some Params are picky.

Put an int or a float param in between the list and the component, to convert the string values to numerical data types.

Yes that what i did but it work fine with sin ,cos and other functions.

That just shows exactly what I’m talking about. Some components are pickier than others.

1 Like

Those have number inputs. That means a conversion from whatever to number is expected. Expressions can operate on strings, so it doesn’t convert those.

In this particular case the deg and rad functions themselves are helpful enough to try and convert their argument into a number. I wrote those. I didn’t write abs.

I thought of that only because they for sure do recognise the string “Pi”

maybe something like this

2 Likes

A little late but joining the “I hate simple codes” party. :sweat_smile: