Round a number to the nearest 10

Can you use the “Math.Round” function to round a number to the nearest 10?
For example, 694 should be rounded to 690. 695 to 700 and so on.
If so, how do you write it?

If “Math.Round” cannot be used for this, what else can be used?

Hi @Haltob01

kindly refer this thread

1 Like

Hey @Haltob01
Welcome back to the UiPath Community.

Please try this simple solution:

1 Like

Hi @Haltob01

Check the sample workflow

MathRound.xaml (4.3 KB)

Regards
Gokul

Math.Round(your_no/10)*10

Just going to leave this here…

To retrieve the last place

Convert.ToDouble(System.Text.RegularExpressions.Regex.Match(doub_round.ToString,"\d(\.\d+)?(?=$)").Value)

image

RoundUpValues.xaml (5.6 KB)

Kind Regards,
Ashwin A.K

1 Like