mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-23 22:45:06 -04:00
New: Project Aphrodite
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
|
||||
function convertToBytes(input, power, binaryPrefix) {
|
||||
const size = Number(input);
|
||||
|
||||
if (isNaN(size)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const prefix = binaryPrefix ? 1024 : 1000;
|
||||
const multiplier = Math.pow(prefix, power);
|
||||
const result = size * multiplier;
|
||||
|
||||
return Math.round(result);
|
||||
}
|
||||
|
||||
export default convertToBytes;
|
||||
Reference in New Issue
Block a user