Console does not set floating point

Asked

Viewed 11 times

0

The variable of type float fish is reading the console, and when I put a value of 12.4, for example, I have it print the same variable, but even forcing a conversion to float, the output on the console is 124, as if the point were simply ignored.

float fish;

Console.Write("Peso > ");
fish = float.Parse(Console.ReadLine());

Console.WriteLine(fish);
  • See also: https://answall.com/q/16089/101

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.