I have an excel in which colomn(Completion status) has values, i want only percentage value to keep there, and also colomn(hours) has decimal values where i want whole number like anything 0.1,0.2,0.3…0.9 = 1 , Please help me out. thanks in advance!!!.Please refer the sample filesamplefile.xlsx (56.9 KB)
Please read the excel to a datatable and inside the for each row activity,
assign row("Completion Status") = System.Text.RegularExpressions.Regex.Match(row("Completion Status").ToString,"(?<=\().*(?=\))")
This will capture only the percentage value.
To convert the decimal values to whole number, Please assign, row("Hours") = cint(row("Hours"))
If you have any doubt, please check this workflow.Excel_Automation_%_Round.xaml (7.7 KB)
I noticed this just now. In the above post, cint(row(“Hours”)) converts a decimal to the next integer number, if it’s fractional part is greater than .5 , like 1.3 → 1 , 1.6 → 2.
If you would like to convert the decimals to intergers like “0.1,0.2,0.3…0.9 = 1”,
Please assign, row("Hours") = math.Ceiling(convert.ToDouble(row("Hours")))