format related problem in SSRS: to show upto # decimal places

  • IN REPORTING SERVICES (SSRS)

    The expression in a cell is like

    =Sum(Fields!a.Value)/Sum(Fields!b.Value)

    in output .. i want to show upto 5 decimal places.

    Is this possible with a format string?? or any other solution??

  • If you only want 5 decimal places to show up you can use the following as your format string.

    #.#####

    The pound sign indicates that only 5 numbers should be shown after the decimal. If you always want 5 decimal places to show even for integers you can use zero's instead of pound signs.

    For example if you use #.##### as your format string , and the value is 5 it will display as 5.

    If the value is 5 and you use #.00000 as your format string, it will display as 5.00000.

    Please let me know if this helps.

  • Hello...

    Please try this once and let me knw if it helps...

    =Format(Sum(Fields!a.Value)/Sum(Fields!b.Value),"#.#####");

    Thanks,

  • this is a partial solution... thanks

    But if the value is calulated to "0"... then nothing is displayed in that cell

    where as output expected is "0.00000"

    similarly ... if the value is calculated to "0.123456789" .... then the output expected is "0.12345" .... and "#.#####" displays it as ".12345"

  • # - specifies an optional placeholder

    0 - specifies required placeholder

    Format(Table!Field.Value,"#0.00000")

    will always return 5 digits after comma.

  • thanks Glen 🙂

    "#0.00000" worked!! 😀

  • My pleasure....

    You can try this...

    =IIf((Field!val1.Value/Field!val2.Value)>0,Format((Field!val1.Value/Field!val2.Value)),"#0.00000"),"0.00000")

    ..Let me knw...if it works..

    Thanks...

  • Hello,

    You can directly Format the TextBox as "N5", then you can get the 5 decimal places for the Number.

    Hope this helps

  • Thanks, Shilpa..

    thats better option to format the textbox to display result upto 5 decimal places

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

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