How to add $ before value in a particular column? I have values in 10’s, 100’s, 1000’s in a column…how to place all of them in a order dynamically?
Hi @johns,
I’m not sure I understand your questions. Could you be a little bit more specific please ?
-
re both questions
where are the columns ? already stored in a datatable or maybe in an excel spreadsheet ? -
re 1st question
do you want the values to be formatted with $ or you want the whole value to be replaced ? -
re 2nd question
is automatic reordering upon new row creation what you mean ?
Best Regards,
Filip
1.Columns are in datatable. (eg., 17,150
2,550
150,887)
2. column value should look like this. In a order $ must come before value (eg., $ 2,000 or $ 150,005)
3. its not a recording.
Hi,
- then you can loop through the datatable and reformat the values with .ToString([format])
- I believe you’re missing my point here; I meant reOrdering not recording by dynamic sorting do you mean that every time a new row is created in the DataTable, it should be automatically placed (inserted in between other rows rather than displayed as a last row) based on the value ?
Best Regards,
Buddy @johns
- Use a read range activity to read the datatable with output variable out_dt
- Use a for each row loop to iterate through each row in a datatable by passing the input as out_dt
- Use a assign activity to add $ symbol to the moneyvalue you have you can do like this
String.Format(“Order Total: {0:C}”, moneyvalue) to assign activity like this
row(“moneycolname”) = Convert.ToInt32(String.Format(“Order Total: {0:C}”, moneyvalue)) - Use a sort data table with input as out_dt and set the properties with columnname that you want to sort like here
No worries buddy let it by dynamic, any how we are sorting finally and can add wherever we want…
Hope this would help you buddy.
Kindly try and let know whether this works or not buddy
Cheers @johns