Search code examples
c#string-formatting

Format Decimal 2 Places - no trailing zeroes


The format: #,# formats my number but it rounds my decimals up. I need to keep my decimals. Is there a format for that?

Thank you.


Solution

  • #,#.###

    Ad as many #s as needed.
    To always show decimal places, use 0s instead.