HighTechTalks DotNet Forums  

DataFormatString for currency?

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss DataFormatString for currency? in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Kat
 
Posts: n/a

Default DataFormatString for currency? - 07-09-2007 , 12:08 AM






I have tried to set a gridview column to have a dataformatstring of {0:c2},
{0:c},{0:d2, {0:d}, none of which work, my values are still displaying as
19.0000. I want it to be 19.00 like any normal currency. Thank you for
your help.



Reply With Quote
  #2  
Old   
martin marinov
 
Posts: n/a

Default Re: DataFormatString for currency? - 07-09-2007 , 03:53 AM






Hello Kat,

Are you sure that your seetings for the currency use dot for delimiter?

Martin

Quote:
I have tried to set a gridview column to have a dataformatstring of
{0:c2}, {0:c},{0:d2, {0:d}, none of which work, my values are still
displaying as 19.0000. I want it to be 19.00 like any normal
currency. Thank you for your help.




Reply With Quote
  #3  
Old   
Kat
 
Posts: n/a

Default Re: DataFormatString for currency? - 07-09-2007 , 10:10 AM



Not sure what you mean, when I use currency formats in other programs, such
as Excel, it works fine. What should I check?


"martin marinov" <mmarinov (AT) developer (DOT) bg> wrote

Quote:
Hello Kat,

Are you sure that your seetings for the currency use dot for delimiter?

Martin

I have tried to set a gridview column to have a dataformatstring of
{0:c2}, {0:c},{0:d2, {0:d}, none of which work, my values are still
displaying as 19.0000. I want it to be 19.00 like any normal
currency. Thank you for your help.






Reply With Quote
  #4  
Old   
marss
 
Posts: n/a

Default Re: DataFormatString for currency? - 07-10-2007 , 03:04 AM



Kat wrote:
Quote:
Not sure what you mean, when I use currency formats in other programs, such
as Excel, it works fine. What should I check?
You did everything right. But there is a feature that is poorly
described in guides. If you want to use DataFormatString then you have
to set
HtmlEncode to false.

<asp:BoundField .... HtmlEncode="False" DataFormatString="${0:C2}"/>

Regards, Mykola
http://marss.co.ua



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.