Assign: Input string was not in a correct format issue

Hi
i am getting error message like Assign: Input string was not in a correct format.

when i am trying to convert string to double
String Value is : 11.117,15

@Naveen.Ch

I think issue with that ‘,’ in that string.

First replace ‘,’ and then try to convert it to double. It will work.

Ex: Str = "11.117,15"
Str = Str.replace(",","")
cdbl(Str)

1 Like

Hi @Naveen.Ch

Try this.

Replace the “.” with “” and “,” with “.”

Test.xaml (4.7 KB)

Let know whether this works for you…

1 Like

Hi @Naveen.Ch,

Buddy …!
is 11.117, 15 two different values like 11.117 and 15. Because we should not take a string with dot and comma as a double, unless you want to convert them to double deliberately. Moreover it can be converted to double in any format like 11.11715 (Removing the comma) or like 11117.15 (removing the dot and replacing comma with dot as @Lahiru.Fernando and @lakshman uggsted ). But unless you want this to be done intentionally, buddy…! we need to check whether it is of two values or to be converted to a single value.

First, if it is to be converted to single value, kindly go with either of the suggestions givenby @lakshman or @Lahiru.Fernando.

or

if they are two numbers, kindly refer to this below xaml converting them to double,

Test.xaml (7.0 KB)

Cheers…!

2 Likes

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