Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DataFormatString for currency?

Reply
Thread Tools

DataFormatString for currency?

 
 
Kat
Guest
Posts: n/a
 
      07-09-2007
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
 
 
 
 
martin marinov
Guest
Posts: n/a
 
      07-09-2007
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
 
 
 
 
Kat
Guest
Posts: n/a
 
      07-09-2007
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" <> wrote in message
news:. com...
> 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
 
marss
Guest
Posts: n/a
 
      07-10-2007
Kat wrote:
> 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I display 221 seconds as 03:41 using DataFormatString Tarren ASP .Net 7 01-20-2005 11:54 AM
DataFormatString Kenny ASP .Net 1 12-31-2004 03:24 PM
How to use DataFormatString? Kenny ASP .Net 3 12-31-2004 05:20 AM
Re: DataFormatString="{0:C}" doesn't show currency victor nguyen ASP .Net 1 09-10-2004 11:06 PM
DataFormatString Doesn't Work frank ASP .Net 1 09-05-2003 04:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57