Convert a string to long/integer while keeping the exact and correct decimal format
Hello, Inside a loop, I have an input string like '$ 3.990,70', I iterate through a list and using the aggregate sum activity, I want to do the sum of the string. To do so, I added a java action to filter out the numeric value from the string and to return a long but it returns 399070 instead of 3.990,70, what should I do to fix the problem knowing that the sum activity only accepts integer/long? Thanks.
You don't need Java for that. If the format 3.990,70 is not dependent from language settings, you can use
otherwise use replaceAll to change the decimal and thousand separators.
Chris de Gelder
From your Design I see you want to convert a decimal to integer
So you can use Change Activity
Set IntegerAttribute = $MyEntity/DecimalAttribute.toInt()