Quantcast
Channel: C# .Net Core - Set global decimal delimiter regardless of culture - Stack Overflow
Viewing all articles
Browse latest Browse all 3

C# .Net Core - Set global decimal delimiter regardless of culture

$
0
0

So I have a development machine which is a dutch machine and a english server.Now, I have values in the database like 1.99 (string) that I need to convert to a decimal.When I do decimal.Parse("1.99") I get 199.00. This is (probably) because my machine uses Dutch settings and the delimiter for a decimal is a , (comma).Now, how can I set it globaly to always use a .(dot) as the delimiter, regardless of the culture that is beeing requested nor the machines local settings?

I'm using a .Net Core Web Api


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>