locked
C# DataFormatString = {0:F2} RRS feed

  • Question

  • User-1132163444 posted

    Hi Please help me,

    decimal value = 1.123456m;
    string format = "{0:F2}";
    var valueWithFormat = value.ToString(format);

    This code returns "{0:F2}" instead of 1.12..??? can any one help me,

    I'm required used this format style "{0:F2}". instead of using "D2" or "C2".

    Tuesday, October 28, 2014 4:07 AM

Answers