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:
My solution:
<?php $inputMeters = intval(readline()); $kilometers = $inputMeters / 1000; echo number_format($kilometers, 2, '.', '');
Use number_format (string function) /line 6 to format the kilometers to the second decimal point.
number_format (string function) /line 6 to format the kilometers to the second decimal point.
622 questions
979 answers
129 comments
53 users