Calculation errors with different languages in vb.net

67 views Asked by At

I have a problem with calculations. I have a site in vb.net, which connects to a 2002-2003 access database, where there is data with comma as decimal separator, and then creates a dataset. The site is in Italian and is hosted on a server in Italy, and it works fine. On the output page there are some calculations made in the codebehind page like this (AverageJan is a decimal, dRow is a dataRow, a cell in the the Access database):
AverageJan = (dRow("JanMin")+dRow("JanMax"))/2

In the web.config page, the culture is: globalization culture="it-IT" uiCulture="it-IT" requestEncoding="utf-8" responseEncoding="utf-8"

I translated the site into French, it is another website but the code is the same. Here, in the web.config, I put the following culture: globalization culture="auto:fr-FR" uiCulture="auto:fr-FR" requestEncoding="utf-8" responseEncoding="utf-8" If I open the site from my home (in Italy) it works fine too, but a person from France wrote me: she opened the site with a mobile phone that had the settings in English, and indeed there were some miscalculations. I think the problem lies with the culture, but I don't really understand what happens.

I tried to put the culture in the web.config like this: globalization culture="fr-FR" uiCulture="fr-FR" requestEncoding="utf-8" responseEncoding="utf-8" but this is even worse: even from my home, the system cannot calculate the average between two numbers (the result is always 0). Does someone have any idea on what is going on? Thank you in advance.

0

There are 0 answers