how to turn off percentage sign in .net/wpf?

Posted by Vitalik on Stack Overflow See other posts from Stack Overflow or by Vitalik
Published on 2010-05-28T22:04:20Z Indexed on 2010/05/28 22:12 UTC
Read the original article Hit count: 197

I would like my WPF application to display all percentages without % sign. For example 20% would be displayed as "20" but i still want to use the standard formatting for percentages (so i get the benefit of string formatter to multiply it by 100 for me)

in other words, how do i get string.Format("0.00%", 0.2) to output "20" but not "20%"?

Is it possible to globally define PercentSymbol as empty string for the entire application?

In particular i am using ContentStringFormat in my WPF application to format the numbers and percentages. Maybe i can do it directly in WPF.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about formatting