I have two values produced from a linear regression
slope = 2.005455
er_slope = 0.01588526
I would like to round the slope value according to the number of decimal places in er_slope. I know the round function allows for this
round(slope, 2)
2.01
However, I don't want to input the value 2. I wish to use a function which does this automatically based on any er_slope decimal places (in case the value changes in the future).