diff --git a/ui/shared/ProgressBar.jsx b/ui/shared/ProgressBar.jsx index f79773656b2..f346cbf0291 100644 --- a/ui/shared/ProgressBar.jsx +++ b/ui/shared/ProgressBar.jsx @@ -4,34 +4,37 @@ import { Progress } from 'reactstrap'; import SimpleTooltip from './SimpleTooltip'; -const ProgressBar = ({ magnitude, regression, color }) => ( - - {/* the % of the bars that are colored and transparent is based on the newIsBetter metric, - which determines whether the colored bar for magnitude is displayed on the left or right */} - - - } - tooltipText="Relative magnitude of change (scale from 0 - 20%+)" - /> -); +const ProgressBar = ({ magnitude, regression, color }) => { + const truncMag = regression + ? (Math.floor((100 - magnitude) * 100) / 100).toFixed(2) + : (Math.floor(magnitude * 100) / 100).toFixed(2); + return ( + + {/* the % of the bars that are colored and transparent is based on the newIsBetter metric, + which determines whether the colored bar for magnitude is displayed on the left or right */} + + + } + tooltipText="Relative magnitude of change (scale from 0 - 20%+)" + /> + ); +}; ProgressBar.propTypes = { regression: PropTypes.bool.isRequired,