📄 modifier.round.php
字号:
<?php /** * Smarty Modifier round * $round The number we're trying to round (don't try this with strings!!) */ function smarty_modifier_round($size) { if ($size < pow(2,10)) return $size." bytes"; if ($size >= pow(2,10) && $size < pow(2,20)) return round($size / pow(2,10), 0)." KB"; if ($size >= pow(2,20) && $size < pow(2,30)) return round($size /pow(2,20), 1)." MB"; if ($size > pow(2,30)) return round($size / pow(2,30), 2)." GB";} ?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -