Skip to content

Refactor code for rounding numeric values of metrics #28

@elray1

Description

@elray1

Consider a refactor of code for formatting numeric values into a helper function (rounding), and add unit tests

Here are 5 places where we round the value of a score. Could we just do it once?

  • text_value = text_value.toFixed(get_round_decimals(col_name));
  • hovertemplate: `model: %{data.name}<br>${thisState.selected_disaggregate_by}: %{x}<br>${score_col_name_to_text(this.state.selected_metric)}: %{y:.${get_round_decimals(this.state.selected_metric)}f}<extra></extra>`,
  • colorbar_tick_format = `.${get_round_decimals(this.state.selected_metric)}f`;
  • colorbar_tick_format = `.${get_round_decimals(this.state.selected_metric)}f`;
  • hovertemplate: `${thisState.selected_disaggregate_by}: %{x}<br>model: %{y}<br>${score_col_name_to_text(this.state.selected_metric)}: %{customdata:.${get_round_decimals(this.state.selected_metric)}f}<extra></extra>`,

this is probably very low priority

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions