jobi Posted May 6, 2011 Report Share Posted May 6, 2011 Hi pilot, how do I get rounded values ​​in the statistics or even appear without a comma? Thanks for your help ... http://v-hp.ath.cx//vms/index.php/acars Joe Quote Link to comment Share on other sites More sharing options...
Tom Posted May 6, 2011 Report Share Posted May 6, 2011 Around the variable you want to round, use: round($var, 2); to round to 2 d.p. or just: round($var); to round to the nearest whole number Quote Link to comment Share on other sites More sharing options...
jobi Posted May 6, 2011 Author Report Share Posted May 6, 2011 How do I build it here as a public static function TotalFuelBurned($airline_code = '') { return self::getTotalForCol(array( 'table' => 'pireps', 'column' => 'fuelused', 'airline_code' => $airline_code, 'where' => array('accepted' => PIREP_ACCEPTED), 'func' => 'SUM', ) ); Thank you for the first time for the help Joe Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted May 6, 2011 Administrators Report Share Posted May 6, 2011 Do it to the value from that function, so: $total = StatsData::TotalFuelBurned(); $total = round($total, 0); # no decimals Quote Link to comment Share on other sites More sharing options...
jobi Posted May 7, 2011 Author Report Share Posted May 7, 2011 Sorry I ask again, I do not know how I do I just get errors insert. I understand it not also be inserted in that file must Thanks, Joe Quote Link to comment Share on other sites More sharing options...
jobi Posted May 9, 2011 Author Report Share Posted May 9, 2011 Ok problem solved itself, but thank you public static function Landingmit($airline_code = '') { return round(self::getTotalForCol(array( 'table' => 'pireps', 'column' => 'landingrate', 'airline_code' => $airline_code, 'where' => array('accepted' => PIREP_ACCEPTED), 'func' => 'avg', )),0); } Joe 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.