Skip to content

Commit

Permalink
fix(Progress): NaN not returned when max and value are zero (#6867)
Browse files Browse the repository at this point in the history
* fix(Progress): NaN not returned when max and value are zero

* Update scaledValue calculation
  • Loading branch information
thatblindgeye committed Feb 7, 2022
1 parent 8c7cf92 commit 184e9f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Progress/Progress.tsx
Expand Up @@ -113,7 +113,7 @@ export class Progress extends React.Component<ProgressProps> {
);
}

const scaledValue = Math.min(100, Math.max(0, Math.floor(((value - min) / (max - min)) * 100)));
const scaledValue = Math.min(100, Math.max(0, Math.floor(((value - min) / (max - min)) * 100))) || 0;
return (
<div
{...props}
Expand Down

0 comments on commit 184e9f0

Please sign in to comment.