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:
parent
b28162ba03
commit
a3aaefbe6e
3 changed files with 192 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue