Files
drop/utils/utils.ts
Paco d8db5b5b85 Adds new tile on the admin home page with system data. (#301)
* Adds new tile on the admin home page with system data. Also fixes the active users bug in the pie chart

* Fixes missing parentheses

* Updates user stats cache when signing in

* Reads active number of users from session provider

* Removes unused variable

* Small improvements

* Removes acl properties from system data websocket and performs initial push of data

* fix: remove acl fetch

---------

Co-authored-by: DecDuck <declanahofmeyr@gmail.com>
2026-01-22 10:58:21 +11:00

8 lines
179 B
TypeScript

export const getPercentage = (value: number, total: number) => {
const percentage = (value * 100) / total;
if (!isNaN(percentage)) {
return percentage;
}
return 0;
};