dbr.avg

(3 posts) (2 voices)

Tags:

No tags yet.

  1. elb98rm, Member

    Hi,

    Is there a way of making dbr.avg work to a certain number of decimal places?

    I have a column "Number of participants", which is an INT.
    If I run average on an INT, it outputs a rounded average.

    I can display the "Number of participants" column using FORMAT(column,2), but this mean that the average can end up being a long (and overly accurate) response.
    Eg: avg 3.2697201017812

    What I really want is INT items, with 1-2 decimal places on the output. Can this be done?
    (if not, it's surely a thing that should be possible in MyDBR)

    Cheers
    Rick

  2. myDBR Team, Key Master

    Hi,
    there is no separate footer formatting as the footer data is formatted same as the column's style.

    You can however format the data using dbr.cellformat, the cell values will be formatted with this style and the footer style will keep the column style as the cellstyle applies only to data cells.

    select 'dbr.avg', 'value';
    
    select 'dbr.colstyle', 'value', '%.2f';
    select 'dbr.cellformat', 'value', 'cellstyle';
    select 'dbr.hidecolumn', 'cellstyle'; select value, '%.0f' as 'cellstyle'
    from mytable;

    And yes, we could add separate footer formatting.

    --
    myDBR Team

  3. elb98rm, Member

    Good hack! I'll try this out now and feed it back.
    Cheers
    Rick


Reply

You must log in to post.