コード例 #1
0
ファイル: functions.php プロジェクト: KOPPKS/firstfile
function convert_mass($value, $from_unit, $to_unit)
{
    $kg_value = convert_to_kilograms($value, $from_unit);
    $new_value = convert_from_kilograms($kg_value, $to_unit);
    return $new_value;
}
コード例 #2
0
function convert_mass($value, $from_unit, $to_unit)
{
    $kg_value = convert_to_kilograms($value, $from_unit);
    $new_value = convert_from_kilograms($kg_value, $to_unit);
    if (empty($kg_value)) {
        return "Please enter a value.";
    } else {
        return $new_value;
    }
}