Ak_4
January 31, 2023, 5:59am
1
I have a data in german format in excel.
Column A Column B Column C
1.234,67 1.234,67 0,00
I want to put condition:-
If Column C <>0,00 then true else false.
My question is how to convert this values in german format and how to give condition for 0,00?
Hi ,
It should work with If coulmn C <> 0 , there shouldnt be any issue . was there any issue?
Ak_4
January 31, 2023, 6:02am
3
My format is different it is in german format so it should be 0,00.
Hi,
0,00 is still 0.
For example , in your excel , if you have applied with German separators , it will still be treated as 0.
so , in your code , you can simply cehck if ColumnC <> 0 , it should work . can you try ?
you can set the excel format as german
https://answers.microsoft.com/en-us/msoffice/forum/all/seperator-in-numbers-in-german/94ba78b8-2b7b-e011-9b4b-68b599b31bf5
Hello @Ak_4
Refer to this thread you may Get some Idea
Looks like you will need to work on your CultureInfo a bit. See here:
First initialize your CultureInfo variable:
nfi = new CultureInfo("pt-pt")
It should be of type:
[image]
Then, assign these:
nfi.NumberFormat.NumberGroupSeparator = "."
nfi.NumberFormat.NumberDecimalSeparator = ","
Finally, do your conversion:
Decimal.Parse("1.000,00", nfi).ToString
It returns:
[image]
Here it displayed it as 1000.00, but that can be fixed by adding your culture to the ToString of the Writ…
Ak_4
January 31, 2023, 6:35am
6
No, u are getting wrong format. Try the different values where u can get the difference of 0,61.
Ak_4
January 31, 2023, 6:50am
8
How we can set the condition?
@Ak_4
Check this Xaml File
ConvertDoubleGerman.xaml (6.5 KB)
Hi @Ak_4
A simple walk-around I can think of, is to treat your inputs as string while processing comparison, like dtExcel(row)(column C).tostring.Equals(“0,00”) and use NOT function if required. this should simplify the processing.
Regards,
karan zaveri
Ak_4
January 31, 2023, 7:43am
11
Please can u send me the image of this. I unable to download it in my system.
@Ak_4
Referto this Image.
system
(system)
Closed
February 3, 2023, 7:56am
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.