Answers for "string to double in c#"

C#
2

convert string into double in c#

Console.WriteLine(Convert.ToDouble("52,8725945"));
Posted by: Guest on July-19-2021
0

Csharp convert string to double

// If you need to convert a string to a double you can use this :
var string = "12,05";
var double = Convert.toDouble(string); // This will be a double with the value of 12,05

// If for some reason you need to convert a string with a "." instead of a "," do this :
var string = "12.05";
var double = Convert.ToDouble(string.Replace(".", ",")); // And this will be the same as previous one
Posted by: Guest on May-06-2022

C# Answers by Framework

Browse Popular Code Answers by Language