evitapr;10949782 wrote:I am having problems with my visual basic 2008 class I really need help!!
Can anybody help me please!!
Well...this is a PHP forum, so while it's quite possible someone here could help, there would likely be a lot more people in a Visual Basic forum.
Should you want to solve your problem in PHP, you could do something like:
<?php
function myRound($value)
{
$decimal = $value - floor($value);
if($decimal <= .25)
{
$value = floor($value);
}
elseif($decimal >= .75)
{
$value = ceil($value);
}
return $value;
}
$values = array(5.24, 5.25, 5.26, 5.5, 5.74, 5.75, 5.76);
foreach($values as $val)
{
echo "<p>$val: " . myRound($val) . "</p>\n";
}