something weird is happening, I have a value from an Excel file and I use Regex.Replace() to transform the value into what I need, locally everything works fine but when I publish the return is different from Regex.Replace():
Given this value: 376900€
I use this code:
x = Regex.Replace(sheet.Cells['D' + row].Text.Replace("€", ""), @"\s+", "");
var Amount = int.Parse(x);
Locally x is: 376900
but when published in a app service x is: 376,900, which throws an exception while parsing to int.
I solved it without using Regex.Replace() but was wondering why is this happening? is it because the server is in North Europe and Regex.Replace() uses some UK conversion or something?
Thanks
My test result. Azure app service reture value same as local.
So MacroMarc's comment is quite right. It should be the data format of this field in the Excel file. When debugging locally, I get 376900€
(according to the local culture/format).
You can deploy your azure web app with debug model. And use remote debugging, to check the value of sheet.Cells['D' + row].Text
. I believe that after debugging, you will find the answer you want.