I have excel sheet with 6 columns
i want columns named Amount1 Amount2 and Amount3 in currency format from General
and columns named Tax1 , Tax2 and Tax3 columns in numbers format from general and also want to add the numbers columns with 3 decimals.
and then need to create a new column as New Tax% in H column and calculate sum of columns of column A, format excel.xlsx (8.2 KB)
C and E/100 in the New Tax% change to percentage format with 3 decimals
ToString() is a method used to convert the value to a string.
"P3" is a format specifier indicating that the number should be formatted as a percentage with three decimal places.
For example, if you have a decimal value 0.12345, using .ToString("P3") would result in "12.345%". It multiplies the value by 100 and adds the percentage symbol (“%”) at the end.
So, in the context of UiPath, row("New Tax%") = (Convert.ToDecimal(row("Column1")) + Convert.ToDecimal(row("Column3")) + Convert.ToDecimal(row("Column5"))) / 100 .ToString("P3") would calculate the sum of certain columns, divide the result by 100, and then convert it to a string representing a percentage with three decimal places.
You can achieve this using Excel Process Scope. Here is sample solution. You haven’t mentioned what to do with column G so it’s kept as it is but if you have to do anything with it you can reuse the logic of other columns.