fix: 🐛 improves storage calculation accuracy

This commit is contained in:
Ravinou 2024-11-15 10:16:39 +01:00
commit fc3f57e24c
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7
2 changed files with 8 additions and 6 deletions

View file

@ -71,9 +71,9 @@ export default function StorageUsedChartBar() {
datasets: [
{
label: 'Storage used (%)',
//storageUsed is in octet, storageSize is in GB. Round to 1 decimal for %.
//storageUsed is in kB, storageSize is in GB. Round to 1 decimal for %.
data: data.map((repo) =>
(((repo.storageUsed / 1000000) * 100) / repo.storageSize).toFixed(1)
(((repo.storageUsed / 1024 ** 2) * 100) / repo.storageSize).toFixed(1)
),
backgroundColor: '#704dff',
},