I am making a calculator in c# for the windows phone and I\'m struggling right now.
Say the user wrote the digits 123,456. What I want to happen is when the user hits t
You could use String.Format("{0:n}", value)
for displaying the numbers with commas. If the user enters commas, strip them when storing them in your program.
Basically, you can store the number internally in the program as a numeric type (such as Decimal
). When the user hits the backspace key (or otherwise enters text), parse the numeric value out of the string and then update the display with the String.Format
operation using the numeric value.