Reputation: 25
How do i format currency with Commas and Decimals in Reportviewer? in C# ? I have been looking up and i have not seen something that does make some sense here
I have a Field called balance now i want to do something like this
=Format(CDec(balance.Value),"N")
I want to have something like this : 1,23456.00
Very new to this.
Upvotes: 0
Views: 3196
Reputation: 398
I've found that it's usually easiest if you cast/format the data in the SQL Query for the ReportViewer.
SELECT FORMAT(Balance, 'C', 'en-us') AS 'Balance'
(where Balance
is your column or value)
Note that if your column or value is a VARCHAR then you'll need to CAST
it to a float first:
SELECT FORMAT(CAST(Balance AS float), 'C', 'en-us') AS 'Balance'
Upvotes: 0
Reputation: 2167
In the design view. Right click in the field. Click on the properties. A new window will popup. There pick number on left side and do your formatting.
Upvotes: 2