Joshua H.
Joshua H.

Reputation: 547

How to automate the format for numbers in wpf textbox

What I want to do is to input number into the textbox and the number will be automatically inserted thousands commas? I have tried to write a algrithm for string, which is only way that I can think about(I'm kinda new for wpf). Is there any easy way to do it?

Upvotes: 2

Views: 5098

Answers (1)

jjrdk
jjrdk

Reputation: 1892

In extension of punker76 answer, then you can use the numeric format:

Text="{Binding YourProperty, StringFormat=n}"

Upvotes: 7

Related Questions