Append decimal to excel row value

hi,

I’m facing issue in appending decimal to row value of Excel.
Excel column containes hours and hours is definned as custom to have decimal value…
But when i tried to read those hours in uipath it’s not showing hours in decimal.

image
Assign activity
listtimer = tempTable.Rows.Item(CurrentIndex)(colTimer).ToString()

Appending missing zeros if necessery
listTimer = listTimer + (IIF(decimalPoints=0,“00”, IIF(decimalPoints=1,“0”,“”))).ToString()

But This appending is not working… It still giving 175 or 27 and not showing as it is, in excel.
can someone help in this issue?

Hi @Latif,

listTimer= listTimer += “,00”

Regards,
Omkar P

@Latif - you can use a simple String.Format method…

String.Format(“{0:0,00}”, 123);

1 Like

Thanks but this will append always 0,00 in every row and i want to handel will if statement as some time i have hours like 23,08 or 75,35 then i don’t want 0,00 after.

my problem is not solved can someone help.

Assign activity - reading table row - hours
listTimer = tempTable.Rows.Item(CurrentIndex)(colTimer).ToString()

Assign activity - replace decimal seperator . with ,
listTimer = trim(tempTable.Rows.Item(CurrentIndex)(colTimer).ToString().Replace(“.”,“,”))

Assign activity - adding ,00 if excel hours is 185
listTimer + “,00”
result = 185,00 perfect

But when hours is like 1,83 then its adding 1,83,00 … acording to my last Assign activity its doing right …
But it is not that what I want.
image
I want ,00 only if there is no “,” in the hours… bec then my value is not correct…
so please help…

@Reddy_Paluri you last answer is not right… it totallygiving wrong value…

kindly read again my assign activities… then you will understand what im expecting

In last small picture … left column is actual hours… 1,83 and i have to match same in SAP…
means I need a IF statement… which is checking… if there is no “,” comma value in excel like 178 og 230 only then I needed to add “,00” after the 178 like 178,00 so that value is matched with SAP

@Reddy_Paluri your first solution gave me right value but I still need is I already have ,40 or 1,43 then I do not need ,00 after that…

list timer is a string variable

if value 1,83 adding this kind of 1,83,00 you don’t want ,00 for this kind of scenario you need to remove ,00

if yes below will work
input=“1,83,00”
output=input.Remove(input.Length -3, 3)
so output will be 1,83

can someone help… my adding 0 is not working…

Excel is showing 5.1 instead of 5,10 and how can i add this 0 again in uipath? can someone help on that…