1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00

Update add revenue calculator

This commit is contained in:
Daniel Neto 2024-03-25 14:53:16 -03:00
parent b28162ba03
commit a3aaefbe6e
3 changed files with 192 additions and 2 deletions

View file

@ -4127,4 +4127,23 @@ function durationToSeconds(duration) {
// Convert everything to seconds
return (hours * 3600) + (minutes * 60) + seconds;
}
}
function formatNumber(num) {
if (num >= 1000 && num < 1000000) {
return (num / 1000).toFixed(1) + 'K';
} else if (num >= 1000000 && num < 1000000000) {
return (num / 1000000).toFixed(1) + 'M';
} else if (num >= 1000000000 && num < 1000000000000) {
return (num / 1000000000).toFixed(1) + 'B';
} else if (num >= 1000000000000) {
return (num / 1000000000000).toFixed(1) + 'T';
} else {
if(num==0){
return '0';
}else{
return num.toFixed(1).toString();
}
}
}