Jump to content

[SOLVED] How can i round to the hundreths in a decimal?


nscherneck

Recommended Posts

Hey everyone,

 

First post here.  Im trying to echo the result of a mathematical calculation and would like to round it to the hundredths.  Heres what ive got...

 

<form id="FormName" action="" method="get" name="FormName">

<p>Unit Name: <input type="text" name="UnitName" size="24"></p>

<p>Unit CFM rating: <input type="text" name="CFMRating" size="24"></p>

<p>Duct Diameter (at detector location): <input type="text" name="Diameter" size="24"></p>

<input type="submit" name="submit">

</form>

<?php

if ($Diameter > 0)

$Radius = ($Diameter / 2);

$SquareInch = ($Radius * $Radius * 3.14);

$SquareFeet = ($SquareInch / 144);

$FPM = ($CFMRating / $SquareFeet);

 

echo "<p>At the detector location the duct is <b>$SquareInch</b> square inches, or <b>$SquareFeet</b> square feet.</p>

<p>The air velocity at the detector location is <b>$FPM</b> Feet Per Minute (FPM).</p>";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.