3
05/11/2024 2:56 e m
Ämnesstart
You will be given an integer that will be distance in meters. Write a program that converts meters to kilometers formatted to the second decimal point.
Examples:
1 Answer
2
05/11/2024 2:57 e m
Use number_format (string function) /line 6 to format the kilometers to the second decimal point:
<?php $inputMeters = intval(readline()); $kilometers = $inputMeters / 1000; echo number_format($kilometers, 2, '.', '');