[Löst] British pounds to Dollars - PHP Task

  

3
Ämnesstart

Write a program that converts British pounds(real number) to dollars formatted to 3th decimal point.

1 British Pound = 1.31 Dollars

Examples:

pounds to dollars php task

2 Svar
3

My solution:

<?php
 
$inputPounds = readline();
$dollar = $inputPounds * 1.31;
 
echo number_format($dollar,3,'.','');
2

On 1 line:

<?php
 
echo number_format(readline()*1.31,3,'.','');
Dela: