Answers for "float and decimals in c#"

C#
5

c# display float with 2 decimal places

myFloatVariable.ToString("0.00"); //2dp Number

myFloatVariable.ToString("n2"); // 2dp Number

myFloatVariable.ToString("c2"); // 2dp currency
Posted by: Guest on April-16-2020
2

what is float in c#

//float in c# sharp is (like in a lot of languages)
//a variable that can contain numbers and fractions
//in contrast to int that is used just for integers
Posted by: Guest on March-05-2021

C# Answers by Framework

Browse Popular Code Answers by Language