Search code examples
c#doublepercentage

Double Percentage round up


hey guys can you help me i will round up the double like this 1.double a = 0,68777777 -> to a textbox.text = 69% 2.double b = 0,54333333 -> to a textbox.text = 54% but how ?


Solution

  • if you are solely looking for the text then you should look into double.ToString(string? format).

    Precisely, you're looking for the "P0" format.