Hi All, I’m getting an error while splitting a string because i have 2 scenarios 1 will come with decimals and another with without decimal. When decimal value comes it is working if it is a normal number it is throwing an error. Can anyone guide me how to write a condition to match both the values in Assign.
Val : 12.456 – it will work
val : 12 – it throws an error
@Sudharsan_Ka if my input is 12.456 or 15 i need output like 12 or 15 . I don’t want the decimal values. I have attached my code but it is working only for the input is like 12.345 , if i give input - 14 it throws an error
we showed you above how to handle e.g. with the truncate.
About your exception:
in the case of 15 - there is no dot present. Therefore the IndexOf will return -1 and this will confuse the substring method