Answers for "c# cast float"

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
5

C# Cast double to float

double double_Num = 42.0349384093;
float float_Num = (float)dNum;

By Barry Cox
Posted by: Guest on March-18-2020

C# Answers by Framework

Browse Popular Code Answers by Language