Format a number as "-" if zero

Unknown
Unknown Active Partner

Hello,

I would like to replace the 0 by - and keep the other numbers formatted as they are, meaning with space between thousand and so on.

Thank you and best regards

Marcel

Answers

  • Helmut Heimann
    Helmut Heimann Employee, Community Captain
    500 Comments 250 Likes Fourth Anniversary 25 Answers

    Hi Marcel Bila,

     

    the challenge here is that you would have to format a number as text. You could achieve that with an algorithm for your measure instead of the cube's value, like

     

    if(a<>0,a,"-") -> format as text

     

    But, this would bring up something else: since any other value <> 0 would be displayed as text as well resulting in an unformatted way (e.g. 1,234,567 would become 1234567). Thus, you'd need another algorithm calculating your cube's value as a number in text format--and that's the "real" challenge (considering different ways of displaying numbers according to the user's settings).

     

    It's up to you to decide whether the effort justifies the result.

     

    Kind regards,

    Helmut

  • NEXEL formulas could help solve the challenge that Helmut Heimann describes.  Look up the FIXED formula in the NEXEL formula library for more details.  

     

    FIXED 

    This function rounds a number to the specified number of decimal places, formats the number in decimal format using a period and commas (if so specified), and returns the result as text.