+ 1
Convert.ToFloat isn't works?
i was coding then i noticed that double x = Convert.ToDouble(Console.Readline()); works. but float x = Convert.ToFloat(Console.Readline()); doesn't works. Whyyy?
1 Answer
+ 7
What you're looking for is actually Convert.ToSingle method from System library which returns a single-precision floating-point value.
You may find out more about Convert methods in official document at
https://docs.microsoft.com/en-us/dotnet/api/system.convert
Hopefully it helps! đ