Answers for "how to convert an into to a float in c#"

C#
7

c# string to float

  class Program
    {
        static void Main(string[] args)
        {
            string str1 = "5.682";
            string str2 = "4.137";
            float flt1 = float.Parse(str1);
            float flt2 = float.Parse(str2);
            Console.WriteLine(flt1 + flt2);
            Console.ReadLine();
 
        }
    }
Posted by: Guest on March-12-2020
6

how to convert float to int c#

float someFloat = 42.7f;
int someInt = (int)someFloat;               // 42
Posted by: Guest on July-01-2020

Code answers related to "how to convert an into to a float in c#"

C# Answers by Framework

Browse Popular Code Answers by Language