t_bergman Posted February 24, 2015 Report Share Posted February 24, 2015 Is there a way to universally set all of the route distances to a whole number and not have decimal places? Quote Link to comment Share on other sites More sharing options...
freshJet Posted February 24, 2015 Report Share Posted February 24, 2015 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']); Quote Link to comment Share on other sites More sharing options...
t_bergman Posted February 24, 2015 Author Report Share Posted February 24, 2015 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');?> Quote Link to comment Share on other sites More sharing options...
freshJet Posted February 24, 2015 Report Share Posted February 24, 2015 <?php echo round($bid->distance) . Config::Get('UNITS');?> That's not a great idea, because the distance will be the same regardless of the unit setting. The distance is always calculated in nautical miles. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.