How to show a comma separated number with StringFormat in XAML?

user3293835 picture user3293835 · Mar 10, 2014 · Viewed 9.3k times · Source

My code currently shows like this: 43521 reviews, I want it be like this: 43,521 reviews. How can I do that? and is there a full reference for all possible formats in StringFormat? couldn't find anything. thanks.

<TextBlock Text="{Binding Reviews,StringFormat='{}{0} reviews'}"/>

Answer

user3293835 picture user3293835 · Mar 10, 2014

This one also worked :)

<TextBlock Text="{Binding Reviews,StringFormat='{}{0:N0} reviews'}"/>