{Binding SampleText, StringFormat='My Text: \{0\}'}
Strings
You can use StringFormat like the c# String.Format() method.
Composite Formatting
Numbers
| C | To display a currency. ex: StrinFormat=C –> $300.00 | 
| N | To display a number. ex: StringFormat=N –> 33,456.56 | 
| E | To display a scientific number. ex: StringFormat=E –> 6.787653e+006 | 
| P | To display a percentage. This value must be between 0 and 1. ex: StringFormat=P –> 33.54% | 
Standard Numeric Format Strings
Custom Numeric Format Strings
DateTimes
| F | StringFormat=F –> Sunday, March 04, 2012 4:22:09 PM | 
| G | StringFormat=G –> 3/4/2012 4:22:09 PM | 
| M | StringFormat=M –> March 04 | 
You can also use the format like “MMMM yyyy” but it must be between ‘ ex: StringFormat=’MMMM yyyy’
Standard date and Time Format Strings
Custom Date and Time Format Strings
No comments:
Post a Comment