Question: All I want to do is use the round function to display the Celsius temperature to one decimal point but I have no idea how to do this.

My code is as follows,

```
<?php
$fTemp = 0;
while ($fTemp <= 100) {
$cTemp = ($fTemp - 32) * .55;
echo $fTemp." Fahrenheit is equal to ".$cTemp." Celsius<br />"; 
$fTemp++;
}
?>

```

Any help would be greatly appreciated.

Answer: 
Use the *second parameter*(precision) of the `round()` function.

### The code..

```
echo $fTemp." Fahrenheit is equal to ".round($cTemp,1)." Celsius<br />"; 

```

The `1` which I have used is the [precision parameter](http://in1.php.net/manual/en/function.round.php) and it will round up to that...

**`OUTPUT`**

```
0 Fahrenheit is equal to -17.6 Celsius
1 Fahrenheit is equal to -17.1 Celsius
2 Fahrenheit is equal to -16.5 Celsius
3 Fahrenheit is equal to -16 Celsius
4 Fahrenheit is equal to -15.4 Celsius
...... Goes on

```
It's likely that you would rather just *display* to a certain accuracy, not change the stored value. As hindmost comments, that can be done with sprintf:

```
sprintf("%.1f", $fTemp);

```

%f is a placeholder for a float or double, and $.1f meand display with one digit after the decimal sign. Well documented here: <http://www.php.net/manual/en/function.sprintf.php>