TimTim
TimTim

Reputation: 25

C# How to Format currency in Reportviewer with Commas and Decimals

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

Answers (3)

Corey Thompson
Corey Thompson

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

phoniq
phoniq

Reputation: 238

=FormatCurrency(balance.Value, "en-US", 2)

Upvotes: 1

Andam
Andam

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.

Step one

Step two

Upvotes: 2

Related Questions