how to specify # decimal places in a SSRS 2005 field

  • how can I specify the # of decimal places to go out on a field in my SSRS 2005 report?

    I read this but doesn't really show the syntax well: http://msdn2.microsoft.com/en-us/library/ms157406.aspx

    I'm trying to format this field (expression shown for the field below) which has the entire expression to only show 2 decimal places:

    =SUM((IIf(Fields!New_Old_CC.Value = 0, Fields!PDC.Value, 0) + IIf(Fields!New_Old_CC.Value = 1, Fields!PDC.Value, 0) + IIf(Fields!New_Old_CC.Value = 0, Fields!CC.Value, 0) + IIf(Fields!New_Old_CC.Value = 1, Fields!CC.Value, 0)) / (Fields!FeeGoal_AZ.Value / Fields!FeeSchedule.Value))

  • right click on the field and goto properties. choose the format that you want.or custom and then put ###,###.## as the format string


    Everything you can imagine is real.

  • if you want those pesky trailing zeros you'd need a format like ###,###.00

    puting in the zeros instead of pound signs ensures a digit shows up in that position

  • Thank you!

  • tHANKS

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

  • Heads up guys - these formatting solutions only appear to work in the report viewer. As soon as you export your report to excel, most formatting goes out of the window.

    # or anything similar appears to get ignored by excel

    F0 and F1 get ignored by excel

    This is a bit of a nightmare, I wish these things worked as expected :unsure:

  • FormatNumber("145.235885555",2)

    will return 145.23

  • hi,

    will it work for % with decimals.

    Kindly help.

    Regards
    Durai Nagarajan

  • durai nagarajan (1/11/2011)


    hi,

    will it work for % with decimals.

    Kindly help.

    P0 for 92%

    P2 for 92.44%

    or in the expression, use FormatPercent(Value, decimalplaces)

    e.g. FormatPercent(Fields.TotalPercent!Value, 2)

    Format percent is not great for Excel however. Whilst it does render, I believe it does so as a string.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply