简体   繁体   中英

Decimal conversion problem in Azure Functions

I have an Azure function that fetches decimal values (from api) and deserializes them (they have "." as decimal separator). When the function is executed locally the decimals are converted correctly, when instead it is executed by azure the decimals are not converted correctly and I find huge numbers. What can this be due to? I thought it could be related to the setting of the decimal separator, or related to the current culture. I would need help solving this problem. Thanks

Try setting the current thread culture using this method: stackoverflow.com/a/7536117/396005

      culture = CultureInfo.CreateSpecificCulture("en-US");
      Thread.CurrentThread.CurrentCulture = culture;
      Thread.CurrentThread.CurrentUICulture = culture;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM