mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Fixed decimal in percentil
Former-commit-id: ad964b4e4e2fa59eae959d5107b63d3c6f96766c
This commit is contained in:
parent
6feaba0b9d
commit
504457f9a6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -251,10 +251,10 @@ export default class Percentile extends Item<PercentileProps> {
|
|||||||
private getProgress(): number {
|
private getProgress(): number {
|
||||||
const minValue = this.props.minValue || 0;
|
const minValue = this.props.minValue || 0;
|
||||||
const maxValue = this.props.maxValue || 100;
|
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;
|
if (value <= minValue) return 0;
|
||||||
else if (value >= maxValue) return 100;
|
else if (value >= maxValue) return 100;
|
||||||
else return ((value - minValue) / (maxValue - minValue)) * 100;
|
else return Math.trunc(((value - minValue) / (maxValue - minValue)) * 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user