Question : Sql Reporting Services formatting a column to currency with precision of 4, hide trailing zeros if not necessary

Hello,

I'm formatting a column to currency on a SQL report.

I need to allow for up to 4 places right of the decimal.  (i.e. $5.1234)

Now, more than often i don't have 4 places to the right so i don't want to see this if the user enters 1 dollar (i.e. $1.0000)

How do i make it so that it would display one dollar as ($1.00 not $1.0000) and display 5.2341 as ($5.2341)

Pretty much, if it has 2 decimal places or none at all than display 2 zeros and if it has more than only show what it needs up to 4 places to the right of the decimal.

Please help, need it soon so it's worth 500 pts.

Answer : Sql Reporting Services formatting a column to currency with precision of 4, hide trailing zeros if not necessary

Another thing, if you are using crystal I know this works, can't you set the format of the cell holding this value in the report to something like this

"$0.00##" This would take care of everything

format(myval,"$0.00##") in code
Random Solutions  
 
programming4us programming4us