Fixed decimal in percentil

Former-commit-id: ad964b4e4e2fa59eae959d5107b63d3c6f96766c
This commit is contained in:
Daniel Maya 2019-04-26 14:37:35 +02:00
parent 6feaba0b9d
commit 504457f9a6
3 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -251,10 +251,10 @@ export default class Percentile extends Item<PercentileProps> {
private getProgress(): number {
const minValue = this.props.minValue || 0;
const maxValue = this.props.maxValue || 100;
const value = this.props.value || 100;
const value = this.props.value == null ? 0 : this.props.value;
if (value <= minValue) return 0;
else if (value >= maxValue) return 100;
else return ((value - minValue) / (maxValue - minValue)) * 100;
else return Math.trunc(((value - minValue) / (maxValue - minValue)) * 100);
}
}