Jump to content

Route Distance Question [SOLVED]


t_bergman

Recommended Posts

Just use

round($schedule->distance)

-

As for universally, the decimal places make it more accurate, so I would leave it but if you really want, go to admin/modules/Import/Import.php and go to line 185:

if($distance == 0 || $distance == '')
{
$distance = OperationsData::getAirportDistance($depicao, $arricao);
}

Change it to:

if($distance == 0 || $distance == '')
{
$distance = OperationsData::getAirportDistance($depicao, $arricao);
$distance = round($distance);
}

And in core/common/SchedulesData.class.php, after line 429, add:

$data['distance'] = round($data['distance']);

Link to comment
Share on other sites

Just use

round($schedule->distance)

-

As for universally, the decimal places make it more accurate, so I would leave it but if you really want, go to admin/modules/Import/Import.php and go to line 185:

if($distance == 0 || $distance == '')
{
$distance = OperationsData::getAirportDistance($depicao, $arricao);
}

Change it to:

if($distance == 0 || $distance == '')
{
$distance = OperationsData::getAirportDistance($depicao, $arricao);
$distance = round($distance);
}

And in core/common/SchedulesData.class.php, after line 429, add:

$data['distance'] = round($data['distance']);

Thanks very much, I ended up just rounding the individual pages I needed as you're right the calculations will be much more precise.

For those who may find this thread later, this is how the code looks.

<?php echo round($bid->distance) . Config::Get('UNITS');?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...