Problem with convert string to integer

0
I have a microflow that has to convert string to integer. I have to convert 1000 records. They have the following excention: ..,0000 or -..,0000 (.. = variable number > Name = VERLOFSALDO) I use in my flow the following call: 'Call ConvertFloat to Int'. My input parameter is: String (VERLOF) and Searchstring ',' After that i create a variable1 (integer/long) with the following initial value: find($String), $SearchString) Then a exclusive split: variable 1 = -1 If true: create variable2 (integer/long): parseInteger($Float, 0) If false: create variable3 (integer/long) parseInteger(substring($Float, 0, $EndChar), 0) Is caused the following error: Caused by: gB: Failed to evaluate expression, error occurred on line 1, character 14 parseInteger(substring($Float, 0, $EndChar), 0) ^ at ld.a(SourceFile:42) Caused by: ai: ai: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at hE.b(SourceFile:37) Caused by: ai: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at hE.b(SourceFile:41) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 Has someone an example for a convert string to integer flow that also contains a string with a negative > - / any idea how i can fix this problem?
asked
1 answers
3

To be honest, the Mx string functions are not the friendliest on earth. They do not differ from java or C#. But that discussion doesn't help you now.

In your case:

  1. Replace the ',' with ''
  2. ParseInteger
  3. Divide by 10000
answered