Answers for "decimal to 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
1

how to convert int to float in c#

int val1 = 1;
float val2 = (float)val1;
Posted by: Guest on September-14-2021

C# Answers by Framework

Browse Popular Code Answers by Language