Forum Discussion

vpatel55's avatar
vpatel55
Icon for Kudo Commander rankKudo Commander
4 years ago
Solved

Format to two decimal places

I'm trying to use FORMAT to get a measure to report to two decimal places. For example, £1.73M. However, the output is only showing £1.7M. It needs to be manually formatted because it will format part of a larger sentence.

 

Here is the formula being used. Any help would be appreciated.

 

 

FORMAT([value],"£#,##,,.0M"

 

 

Thanks.

  • Hi vpatel55 ,

     

    I think you need two 0s at the end to force the decimal places, instead of the #s earlier. 

     

     

    FORMAT([Value],"£#,,.00M")

     

     

     

4 Replies

  • AntonioM's avatar
    AntonioM
    Icon for Solution Sage rankSolution Sage

    Hi vpatel55 ,

     

    I think you need two 0s at the end to force the decimal places, instead of the #s earlier. 

     

     

    FORMAT([Value],"£#,,.00M")

     

     

     

    • simonqish's avatar
      simonqish
      Regular Visitor

      I wish it were this easy for me. Maybe you know what is wrong in my measure?


      No matter what I try, I can't get it to give me a proper value of $3.36. It gives me $3.30 instead. Same for other outputs of this measure: 31.50 insted of 31.53 and 1.40 instead of 1.39.
      Seems it is rounding to the first decimal and just giving me zero as the second one.

      I'd really appreciate any help on this.

      • AntonioM's avatar
        AntonioM
        Icon for Solution Sage rankSolution Sage

        hi simonqish ,

         

        So that should work as it is. I've tried it with a couple of numbers just in a table and it formats to two decimals like you're after.

         

         

        What visual are you using that in? It could be forcing its own formatting somehow.

         

        Another option, if you only need the value on its own, you can keep the measure as a number (so without FORMAT) then set it to currency and two decimal places up in the 'Measure Tools'.