in excel, my amount column values is given as:
25000
5000
1000
0
2500
10000
500
can anyone give me string manipulation method to get values as follows:
25,000
5,000
1,000
0
2,500
10,000
500
in excel, my amount column values is given as:
25000
5000
1000
0
2500
10000
500
can anyone give me string manipulation method to get values as follows:
25,000
5,000
1,000
0
2,500
10,000
500
Use for each
then use format value activity
in that select number
Hope this helps
Ctrl + 1
to open the Format Cells dialog.Your values will now be displayed in the desired format:
HI @Mohammad.Fuad ,
Have you tried it
https://docs.uipath.com/activities/other/latest/productivity/format-range-x
how to obtain only 1,000 . I dont want decimal points.
use this Linq:
Assign activity:
(From row In inputDataTable.AsEnumerable()
Let formattedAmount = If(String.IsNullOrEmpty(row("Amount").ToString()), "",
If(IsNumeric(row("Amount").ToString()),
Convert.ToDecimal(row("Amount")).ToString("N0"),
row("Amount").ToString()))
Select New With {
.Amount = formattedAmount
}).CopyToDataTable()
Cheers…!
then remove the value after decimal
using regex or split function
Try this:
- Read Excel File (e.g., "Read Range" activity into dtExcel)
- For Each Row (in dtExcel)
- Assign: row("Amount") = String.Format("{0:N0}", Double.Parse(row("Amount").ToString()))
- End For Each
- Write Excel File (if needed)
Hope it helps!!
Hi,
you can use below expression:
row(“Amount”) = String.Format(“{0:N0}”, Convert.ToInt32(row(“Amount”).ToString))
row("Amount")
: This is where we look at the value in the “Amount” column of the data.
Convert.ToInt32(row("Amount").ToString)
: We take that value and make sure it’s treated as a whole number (integer) even if it was in a different format.
String.Format("{0:N0}", ...)
: This part is like a command to format the number we just converted. {0:N0}
means “format the number with no decimal places and add commas for thousands.”
row("Amount") = ...
: Finally, we replace the original value in the “Amount” column with the newly formatted one. So if the original value was 25000, it will now be 25,000.
it takes a number from Excel data, turns it into an integer (a whole number), and then makes it look nice with commas for thousands.
try this
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.