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.
=FormatCurrency(balance.Value, "en-US", 2)
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'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.