Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $value = floatval(readline());
- $input = readline();
- $output = readline();
- if ($input === "mm") {
- $value /= 1000;
- } else if ($input === "cm") {
- $value /= 100;
- }
- if ($output === "mm") {
- $value *= 1000;
- } else if ($output === "cm") {
- $value *= 100;
- }
- echo number_format($value, 3, ".", "");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement