Reputation: 76
I'm trying to parse the string "78,74"(which is a valid number in Brazil's format) to double, but I'm getting Format Exception and I can't find any way to parse it... Already searched in intl docs but there's nothing helpful.
I don't want to replace the "," with "." because i think that it must be a way to parse it using CultureInfo
My code is like
String x = "78,74";
double d = double.tryParse(x)
Upvotes: 1
Views: 1684
Reputation: 3229
Localization support for parsing numbers can be found in package:intl. For this particular case, you're looking for the parse method from NumberFormat.
Upvotes: 1