My_Model returns int from float

edited May 2014 in Bug Reports
I'm not sure what's happening here, but I'm trying to return the value of a float, but it's only returning an int:

$test = this->reviews_model->find_by_key('45')->stars; print_r($test);
I only get:
3

Whereas with:
$test = $this->db->select('stars')->from('testimonials')->where(array('id' => '45'))->get()->row(); print_r($test);
I get:
stdClass Object ( [stars] => 3.5 )

I'm not sure why. Fuel shows 3.5 in the back, everything looks clear. Did I change something that caused this issue?

Thanks :)

Comments

  • edited 6:29AM
    What version of FUEL is it? There was an issue with this a few patch versions ago that should have resolved something that sounds similar to your issue.
  • edited 6:29AM
    Looks like I'm on version 1.0.2, and 1.0.6 is the newer version. I'll update and see if it makes a difference.
    Question: When updating Fuel, all I need to do is replace /fuel/modules/fuel correct?
  • edited 6:29AM
    Yup, that fixed it!

    Thanks! :)
  • edited 6:29AM
    If you are using Git, you can just do a pull from the master branch as well.
Sign In or Register to comment.