Tuesday, July 19, 2011

format number with 2 decimal places in XAML presentation

In Silverlight XAML presentation, you can use the following code to format number with 2 decimal places in data binding:

<TextBlock Text="{Binding Amount, StringFormat=n, Mode=TwoWay}"/>

Edit:
StringFormat='C'

StringFormat='N3'

StringFormat='yyyy MMM dd'

This sample shows StringFormat markup extension. C for currency, N3 for a number with 3 decimal places and yyy MM dd for a date that displays year 3 letter month and 2 number date.

Keep on typing! Code and code until you succeed!

2 comments:

Unknown said...

I am hopeful that one day I will meet that right man and will have a very happy life partner. See the link below for more info.


#one
www.ufgop.org

yosabrams0918 said...

After examine a number of of the blog posts in your website now, and I really like your approach of blogging. I bookmarked it to my bookmark web site checklist and can be checking again soon. Pls check out my web page as effectively and let me know what you think. online casino