Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data grid money format ?!?!
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00839982
Message ID:
00840164
Vues:
26
OK, I have to renege on this statement. As it turns out ... str(ProductPrice, 12,2) as [Retail] ... is a better choice if you allow sorting and for a more consistent layout. The cast to varchar sorted as you might expect 1,11-19,2,20-29,3 etc. Whereas, the str() method, which agreeably should sort the same way, sorts 1,2,3 ... 8,9,10,11,12 etc. This is a subtle nuance that I found in testing. I hope this helps someone.

My Thanks,

>Since I build the query on the fly I don't think that is available for me :( at least I couldn't find a way to do it in code... I wound up using a CAST right in my SQL statement ... CAST(ProductPrice AS varchar(12)) as [Retail] ... ProductPrice is money datatype and the grid gave me 4 digits to the right of the decimal. All I wanted to show was 2. This works fine and allows me to filter columns as yet unknown.
>
>If I missed something please fill me in. ;)
>
>My thanks,
>
>>Hi Joe,
>>
>>You can set the DataFormatString for the BoundColumn to:
>>
>>{0:c}
>>
>>Which will format the data as currency (thereby putting in the $, decimal place, and appropriate digits after the decimal place).
>>
>>
>>>I have a grid with a dynamic SQL that has a SQL data type 'money' that insists on the full display of 4 decimal places to the left. How can I format the col on the fly?
>>>
>>>My thanks in advance,
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform