Round all numbers to 'x' nr of decimals using Python or C#

Hi,

Is there someone who can write a python code or C#, a component which rounds all numbers to a x number of decimals?

Inputs:
A = input with multiple lists and branches full of numbers
B = ‘number’ of decimals to round to

A = 1,3345 2,7899
B = 2 → round all numbers to 2 decimals

Output:
1,33
2,79

Thanks

How about this?

RoundF.gh (4.1 KB)

– Dale

1 Like

You can use Expressiom component and write “round(x, y)” . No need for c or python.

2 Likes

haha indeed! thanks!

Thanks!