Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit ef74632

Browse files
committed
normalize percentages
1 parent 61ed674 commit ef74632

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/routes/stats/versions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ mod get {
4646
.await
4747
.unwrap();
4848

49+
let total = data.iter().map(|row| row.percentage.unwrap()).sum::<f64>();
4950
for row in data {
5051
versions.insert(
5152
row.version.unwrap(),
52-
(row.percentage.unwrap() * 100.0).round() / 100.0,
53+
(row.percentage.unwrap() / total * 10000.0).round() / 100.0,
5354
);
5455
}
5556

0 commit comments

Comments
 (0)