Follow

Comments

3 comments

  • Avatar
    Chris Watson

    But if it's an integer, why show it as a decimal?

    I've got this Single Value Viewer, which will only ever be an integer:

    I don't want to convert to a string because then I can't use the Colours by Value Range feature, which is very handy on a dashboard.

    Any plans to let us choose the number of decimal places to show?

    8
    Comment actions Permalink
  • Avatar
    Rajesh Goel

    Moreover the aggregate functions cannot be plotted as graph if it is not a number. So please suggest a viable solution if I want to show only 2 decimals.

    I did the below but now it is not showing me it as graph:

    • | round(_avg, 1) as _avg
    • | format("%.1f", _avg) as _avg

    If I add the below (to the above):

    • | num(_avg) as _avg

    then it enables the graphing option (like chart) but it displays the trailing 3 zeros, which I do not want

    • 47.90000

    Any suggestion?

    0
    Comment actions Permalink
  • Avatar
    Phil Cutajar

    Format allows you do specify the decimal places you want. To eliminate decimal places, format the output with zero decimal places...

    • | sum(Received) as Received, sum(Processed) as Processed
    • | (Processed / Received)*100 as Percent | format("%.0f",Percent) as Percent

    If you want two decimal places, then... 

    • | format("%.2f",Percent) as Percent

     

    0
    Comment actions Permalink

Please sign in to leave a comment.