mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-20 03:29:35 +05:30
14 lines
409 B
PHP
14 lines
409 B
PHP
<?php
|
|
// function to format given number in youtube views style
|
|
function format_number_in_yt_style($num) {
|
|
if ($num >= 1000000000) {
|
|
return number_format($num / 1000000000, 1) . 'B';
|
|
} elseif ($num >= 1000000) {
|
|
return number_format($num / 1000000, 1) . 'M';
|
|
} elseif ($num >= 1000) {
|
|
return number_format($num / 1000, 1) . 'K';
|
|
} else {
|
|
return $num;
|
|
}
|
|
}
|
|
?>
|