How to remove zeros from the end of a double/int/string variable

I need to use values extracted from a xml file to filter a datatable, this datatable is created in a read csv file activity.

in the csv file, the values does not ends with 0. For example: price $ 120,50 in the csv file will be 125,5. price $ 120,00 in the csv file will be 120.

in the xml file the values end with 0, sometimes there are more 0 that we need (Example: $ 90.00000000)

The problem is: when i extract the value from the xml it has all the 0 but if i use this value to filter the datatable it will not return anything because in dt the values does not ends with 0

I can’t use length-2(or length-3 because of the “,”) because of values like 120,43

Below is an example of the xml and csv file

image

image

the tag qCom is the column “Quantidade”
vUnCom is “Valor_unitario”
vProd is “Valor_Total”

I’m tying to use this informations to return the value in “Item” column, because this values (qCom, vUnCom, Vprod) are the only thing in the xml that is equal in the csv file, and i need this “Item” to continue with a biggier automation project.

Note: Each det tag in the xml file is one row at csv file

i understand price 120,00 in the csv file will be 120.
but how does 120,50 become 125,5?

1 Like

@guilherme.dias try this

double.parse(price.Replace(",",".")).ToString
where price is the price variable string .e.g 90.00000

example
image

2 Likes

In the csv file the zeros at the end of a value are cutted

look at this example:

image

image

Vprod is 212,50 and Valor_total is 212,5

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