Replace number with given numbers

Hey

I have list of number which consists of

5
61
7
74
86
95
9
99

This list will contain 100’s of these values.
I need to replace them with.

1.0
1.2
1.4
1.48
1.72
1.8
1.9
1.98

So

5 = 1.0
61 = 1.2
7 = 1.4
74 = 1.48
86 = 1.72
95 = 1.8
9 = 1.9
99 = 1.98

Number
5
and
7
where meant to be 50 and 70 but I derived them from a decimal place and grasshopper changes
0.50 to 0.5
0.70 to 0.7
0.90 to 0.9
Thanks.

There seems to be a perfectly linear relationship between your input and your output, which means you can just run the values through an expression rather than try difficult find/replace logic. Would that work?

I think it might work but I’m new to grasshopper and I don’t know how to construct anything, especially expression which I cannot even copy.

I solved it like this ;/

but it still doesn’t work ;/?

This is my structure

I would have though it would create shapes with 1’s first (at the bottom) and then go up but it seems like it chooses values randomly. Why?

I can’t tell from looking at images. Please simplify your file as much as possible and upload it in accordance with this.

If you have a list of numbers that need to become a different list of numbers and there’s an equation for converting them, that’ll be the easiest solution. But I need to actually have the data you have otherwise I can’t tell what solution would work.

test 5.gh (14.1 KB)

Geometry does not follow the order of the panel.

First value is 1.4 but grasshopper will generate 1
Second number is 1.4 but grasshopper will generate 1.2
I want it to follow the order shown in the panel.
Really confusing.

You mentioned that 5 and 7 were meant to be 50 and 70 but that they were changed by Grasshopper. Does that mean that you have actual numbers somewhere before you turn them into text?

2 Likes

or:

: )

No they were always fractions. But I’m really worried about my second problem. Which is geometry generation. Grasshopper takes one number from start one from the middle and one from the end it groups them but nowhere I defined the grouping. The height of the structures should follow the list from start to end.