none
Negative zero formatting RRS feed

  • Question

  • Hi All,

    What number format I should use to get below output

    32.383 - 32.881 = -0.49799

    I would like to show -0.49799 as (0)

    Not -(0) or -0

    Thank you - AK


    Ashok Ojha



    • Edited by AshokKOjha Tuesday, October 15, 2019 9:18 PM
    Tuesday, October 15, 2019 7:34 PM

Answers

  • I really appreciate all your help. Finally this worked for me

    =IIF(Me.Value > -0.5 AND Me.Value < 0,"(#,##0)",IIF(Me.Value < 0,"#,0;(#,0)",IIF(Me.Value > 0,"#,0;(#,0)","#,0;(#,0);'-'")))

    Very specific ask from user - when its true 0 they want to see "-" , for numbers -0.23 or -0.56 they want to see (0), others okay like -12.4 as (12) and 12.4 as 12.

    The only trick worked for me is when values is between -0.5 and less then 0 I am using "(#,##0)" to support (0) output, otherwise no issues in using "#,0;(#,0)".

    SSRS till rocks :)


    Ashok Ojha

    • Marked as answer by AshokKOjha Wednesday, October 16, 2019 6:30 PM
    Wednesday, October 16, 2019 6:29 PM

All replies

  • Hi AK,

    Not exacting sure about what your processing rule is, but I am guessing that you are looking for round function?

    You could try following

    =round(32.383 - 32.881)

    Regards,

    Lukas


    MSDN Community Support Please remember to click Mark as Answer; the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 16, 2019 1:02 AM
  • I would like to show -0.49799 as (0)

    You mean the format used in US finacial reports? Then use the Format similar to Excel =>

    0;(0)


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Wednesday, October 16, 2019 8:12 AM
  • 0;(0) for returns only 0. I don't need to show decimal places but I need to show sign, expected output is (0) but without decimal it shows 0.

    Ashok Ojha

    Wednesday, October 16, 2019 1:02 PM
  • Hi 

    Can you try with the below code and let me know how it goes.

    =IIF(ROUND(32.383 - 32.881)=0,"(0)",32.383 - 32.881)

    Hope this is helpful !!

    Thank you


    If this post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered "Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.

    Wednesday, October 16, 2019 2:53 PM
  • I really appreciate all your help. Finally this worked for me

    =IIF(Me.Value > -0.5 AND Me.Value < 0,"(#,##0)",IIF(Me.Value < 0,"#,0;(#,0)",IIF(Me.Value > 0,"#,0;(#,0)","#,0;(#,0);'-'")))

    Very specific ask from user - when its true 0 they want to see "-" , for numbers -0.23 or -0.56 they want to see (0), others okay like -12.4 as (12) and 12.4 as 12.

    The only trick worked for me is when values is between -0.5 and less then 0 I am using "(#,##0)" to support (0) output, otherwise no issues in using "#,0;(#,0)".

    SSRS till rocks :)


    Ashok Ojha

    • Marked as answer by AshokKOjha Wednesday, October 16, 2019 6:30 PM
    Wednesday, October 16, 2019 6:29 PM