mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-20 05:49:35 +05:30
(feat): added hoverable project info tooltip card
This commit is contained in:
14
htdocs/core/utility_functions.php
Normal file
14
htdocs/core/utility_functions.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user