I have fields called price
and minIncrement
in my DataSet for my SSRS 2012 report. I want to format the price
using an expression based on the minIncrement
field. For example if the price
is 94.95000
and the minIncrement
is 0.01
, then I want the price
displayed on the report as 94.95
. If the price
is 12345.000000
and the minIncrement
is 1
, then display the price
as 12345
.
Is there a way to do that? Possible minIncrement
values are
0.000100
0.010000
0.100000
0.250000
1.000000
You could create an expression, something like:
=Format(
Fields!Price.Value,
Switch(
Fields!MinIncrement.Value = 0.000100, "0.0000",
Fields!MinIncrement.Value = 0.010000, "0.00",
Fields!MinIncrement.Value = 0.100000, "0.0"
)
)
Just expand the Switch
statement with the other possible values for MinIncrement.
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.