❔ error when converting string to long
you can see on image from what im trying to convert
15 Replies
string value:
"-3.7193950756378277"
Longs can't have decimals
Are you thinking of double?
okay but tried this with double and didnt work either
let me change it back to double
Also, decimal parsing is culture specific
$invariantculture
In different cultures "," and "." are used for decimal points (and even other symbols sometimes). Here what you can write use Invariant culture (with dot):
Or use Try-pattern
let me add Culture
works now
impossible
thanks
can i set like
global Culture
or i need to add this argument to every Parse method
I think you should be able to set it
ngl it kinda frustrates that C# by default is local
yeah you can set currentculture
Apparently some dumbass thought that US-only date format is "invariant culture"
they even did time correctly
why date is in random order 🤦
bros aint thinkin out there in microsoft
I'm not saying they aren't
but some decisions aren't really thought at all
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.