Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - DataFormatString="${0:C2}"

 
Thread Tools Search this Thread
Old 08-08-2006, 09:49 PM   #1
Default DataFormatString="${0:C2}"


Howdy,

In my GridView i have some bound columns displaying currency. I have
DataFormatString="${0:C2}" in one of the columns but the value being
displayed is $35 . If the price has cents, then it will display the cents,
like $35.3 or $35.55, but where there's no cents, it just displays $35.
Shouldn't this override any datatypes from the datasource. Just to cofirm I
am sending a valid datatype, I checked everything out and this gridview is
being loaded from a arraylist of a class. The class has the following
property, which is even formatted there but it doens't matter...

Public ReadOnly Property Price() As Double

Get

Return FormatNumber(_price, 2)

End Get

End Property

Thanks!!

--
David Lozzi
dlozzi@(remove)delphi-ts.com
www.delphi-ts.com





David Lozzi
  Reply With Quote
Old 08-08-2006, 09:57 PM   #2
=?Utf-8?B?Y2xpY2tvbg==?=
 
Posts: n/a
Default RE: DataFormatString="${0:C2}"
For some reason i have yet to understand you have to set the HTMLEncode
property to false or the DataFormatString is basically ignored.

"David Lozzi" wrote:

> Howdy,
>
> In my GridView i have some bound columns displaying currency. I have
> DataFormatString="${0:C2}" in one of the columns but the value being
> displayed is $35 . If the price has cents, then it will display the cents,
> like $35.3 or $35.55, but where there's no cents, it just displays $35.
> Shouldn't this override any datatypes from the datasource. Just to cofirm I
> am sending a valid datatype, I checked everything out and this gridview is
> being loaded from a arraylist of a class. The class has the following
> property, which is even formatted there but it doens't matter...
>
> Public ReadOnly Property Price() As Double
>
> Get
>
> Return FormatNumber(_price, 2)
>
> End Get
>
> End Property
>
> Thanks!!
>
> --
> David Lozzi
> dlozzi@(remove)delphi-ts.com
> www.delphi-ts.com
>
>
>
>



=?Utf-8?B?Y2xpY2tvbg==?=
  Reply With Quote
Old 08-09-2006, 01:51 AM   #3
David Lozzi
 
Posts: n/a
Default Re: DataFormatString="${0:C2}"
Wow, why does that make sense?!?

Thanks for the help!

--
David Lozzi
dlozzi@(remove)delphi-ts.com
www.delphi-ts.com


"clickon" <> wrote in message
news:6ADABBAB-A64D-439F-9BCE-...
> For some reason i have yet to understand you have to set the HTMLEncode
> property to false or the DataFormatString is basically ignored.
>
> "David Lozzi" wrote:
>
>> Howdy,
>>
>> In my GridView i have some bound columns displaying currency. I have
>> DataFormatString="${0:C2}" in one of the columns but the value being
>> displayed is $35 . If the price has cents, then it will display the
>> cents,
>> like $35.3 or $35.55, but where there's no cents, it just displays $35.
>> Shouldn't this override any datatypes from the datasource. Just to cofirm
>> I
>> am sending a valid datatype, I checked everything out and this gridview
>> is
>> being loaded from a arraylist of a class. The class has the following
>> property, which is even formatted there but it doens't matter...
>>
>> Public ReadOnly Property Price() As Double
>>
>> Get
>>
>> Return FormatNumber(_price, 2)
>>
>> End Get
>>
>> End Property
>>
>> Thanks!!
>>
>> --
>> David Lozzi
>> dlozzi@(remove)delphi-ts.com
>> www.delphi-ts.com
>>
>>
>>
>>





David Lozzi
  Reply With Quote
Old 08-09-2006, 03:48 AM   #4
Kenan Kilictepe
 
Posts: n/a
Default Re: DataFormatString="${0:C2}"
AFAIK it is a bug.

Kenan Kilictepe

"David Lozzi" <> wrote in message
news:...
> Wow, why does that make sense?!?
>
> Thanks for the help!
>
> --





Kenan Kilictepe
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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