Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data grid money format ?!?!
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00839982
Message ID:
00840177
Views:
16
Joe,

The technique I showed was formating in the datagrid. The way you have done it, in the SQL statement will also work.

>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,
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform