Thursday, September 10, 2009

Convert Numbers with 2 decimal places in gridview Template field



Note:

if you are using template field in gridview and wants to convert number field in decimal places(2 and more places) just use Text='<%# Bind("Project_cost", "{0:N}") %>' in itemTemplate field.
It will convert your field values with 2 decimal places
like : your number is -44
after converting - 44.00


Same thing if you want to do with bound field use DataFormatString="{0:N}" in the required field

Keep visiting for more Information
sites.google.com/site/santo01org/
Best of luck

No comments:

Post a Comment