Mahmood Jenami
Mahmood Jenami

Reputation: 431

thousand separator for integer in formatString

I want to show the numbers in text block with thousand separator in xaml but without floating point. how can i do it. i tried the following codes:

StringFormat={}{0:N}

it shows floating point.

StringFormat={}{0:000'.'000}}

it shows 1234 like 001,234 how can it do it?

Upvotes: 14

Views: 15060

Answers (2)

dangalg
dangalg

Reputation: 6486

For me this worked:

Label Text="{Binding Price, StringFormat='{}{0:N0}'}"

Upvotes: 2

Hamlet Hakobyan
Hamlet Hakobyan

Reputation: 33391

Use

{Binding StringFormat={}{0:N0}}

The good article about formatting in bindings.

Upvotes: 27

Related Questions