ROUND OFF

I wanna round of the value from 0.045 to 0.5 in uipath, is there any way to do this?

Hi @Manikandasamy

Yes, you can do it by converting and assigning the value with below code.

Math.Round(value, 2);

3 Likes

Nope, this will not return my expected result, this will take no of digits,

The result will be 0.04. Thanks for your help. :slight_smile:

You need it to be 0.5 or 0.05?

You can actually the below if you wanted 0.045 to become 0.05

Math.Round(0.045, 2, MidpointRounding.AwayFromZero)

4 Likes

@Varun_Raj 0.05

If i want to round 0.145 to 0.15 will the same work?

For that we might have to go to a different approach actually. Since mathematically 0.145 falls under the threshold boundary for 0.15.

Yes, do we have a way to handle both scenarios?