3
05/11/2024 2:54 pm
Topic starter
Write a program that converts British pounds(real number) to dollars formatted to 3th decimal point.
1 British Pound = 1.31 Dollars
Examples:
2 Answers
3
05/11/2024 2:55 pm
My solution:
<?php $inputPounds = readline(); $dollar = $inputPounds * 1.31; echo number_format($dollar,3,'.','');
2
05/11/2024 2:56 pm
On 1 line:
<?php echo number_format(readline()*1.31,3,'.','');