Round up from 3 decimal places to 2 decimal places

I am trying to round up from 3 decimal places to 2 decimal places. It gives the floor value.!
Given the value 0.105, I want it to round up to 0.11.
image|212x102

@aqiff

Try below one.

         Math.Round(0.105,2)

Hi,

Hope the following helps you.

Math.Ceiling(Double.Parse("0.105")*100)/100

Regards,

Hi
If your input is Ina a string variable named strinput

Then use a assign activity like this

stroutput =(Math.Ceiling(Double.Parse(“0.105”)*100)/100).ToString

Cheers @aqiff

Thank you for this solution !

1 Like

But wait, how about when we have value that is 0.103? it will give us 0.11 … which is not true …

Try this one:

Math.Round(Double.Parse(“0.105”),2, MidpointRounding.AwayFromZero)

This is similar to your initial approach, you should just add the MidPointRounding in the end.

1 Like

Wow this is a very good one !

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.