Reduce the decimal points in Excel

Hi Vicky, I’m unable to view your post.

Hello @BaskaranVenkatesan

Decimal Zip.zip (8.6 KB)

Also Try this and let me know about this code
(From x In UnitPriceDT.AsEnumerable() Select UnitPriceDT.Clone.Rows.Add({CStr(If(CStr((x("Unit Price"))).Contains("."),CStr(x("Unit Price")).Split("."c)(0)+"."+CStr(x("Unit Price")).Split("."c)(1).Substring(0,2),x("Unit Price"))) })).copytodatatable

Hi Vicky, Ok sure i’ll check and get back to you.

Hi Vicky,
Thanks for your reply. I had used your code, after run the bot i had checked the decimal points and it has been reduced but after the unit price columns are blanked. Hence i have write the code using Excel VBA for resolve that issue.

When run the macro decimals are converted to entire column like as"123.31" but when i update in the portal using Type into activity its keying 123.305. Please advise.

Hello @BaskaranVenkatesan
The reason previous error occurred was your column contained some blank cell’s so it was unable to convert it to Double
I am talking about this error

Check if you have blank values in your excel sheet

To this problem the solution is you have to type all the column name in the code and it’ll give you all columns
like this

(From x In UnitPriceDT.AsEnumerable() Select UnitPriceDT.Clone.Rows.Add({CStr(If(CStr((x("Unit Price"))).Contains("."),CStr(x("Unit Price")).Split("."c)(0)+"."+CStr(x("Unit Price")).Split("."c)(1).Substring(0,2),x("Unit Price"))),cstr(x("ColumnName")) })).copytodatatable
this code would be better solution than vba

are you running the macro after or before type into
and can you show the macro you are using ?

Hi Vicky,

Good Day!

I had used above code until “Unit Price”. Now it has been working fine. If any support require i’ll let you know.Thanks for your support!

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