mirror of
https://github.com/igorsimdyanov/php8.git
synced 2025-08-03 16:43:03 +00:00
10 lines
190 B
PHP
10 lines
190 B
PHP
<?php
|
|
function convertToGrams(int $value, int $factor = 1_000) : int
|
|
{
|
|
return $value * $factor;
|
|
}
|
|
|
|
echo convert(11, 1024); // 11264
|
|
echo '<br />';
|
|
echo convert('10.0', 1024.0); // 10240
|