Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

[SOLVED] format value while php

$
0
0
Hi
I am putting together a table and I want to change the format in view of the query.
in this way the kilograms appear to me thus 701.9999999999999 Kg.
and I would like them to appear with the format 2, '.', ''
That would be 701.99 kg but I don't know how to do it. I leave the table example


echo "<table class='table'>";
echo "<tr>";
echo "<th>CANTIDAD DE PESADAS</th>";
echo "<th>TOTAL DE KILOGRAMOS</th>";
echo "</tr>";

while ($columna1 = mysqli_fetch_array( $resultado1 ))
{
echo "<tr>";
echo "<td><h4><b>".$columna1['total1']." </h4></td>";
$numero1=$columna1['total1'];

}
while ($columna = mysqli_fetch_array( $resultado ))
{

echo "<td><h4><b>".$columna['total']." Kg.</h4></td>";
$numero=$columna['total'];
echo "</tr>";
}


echo "</table>";

Viewing all articles
Browse latest Browse all 2586

Trending Articles