Answers for "c# show string with 2 decimal places"

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
0

C# decimal with two places store as string with two places

public static string DoFormat( double myNumber )
{
    var s = string.Format("{0:0.00}", myNumber);

    return s;
}
Posted by: Guest on January-27-2021

Code answers related to "c# show string with 2 decimal places"

C# Answers by Framework

Browse Popular Code Answers by Language