Reputation: 2455
I want to insert this value in a FLOAT(3,1) column in my Database:
$sec['votos_rating'] = 5 + ($sec['votos_pos'] * (5 / $sec['votos_total'])) - ($sec['votos_neg'] * (5 / $sec['votos_total']));
But I always get 1.0
, 2.0
, 3.0
, etc...
Do you know what could I be doing wrong?
This was the problem:
$db->addInteger('votos_rating', $sec['votos_rating']);
I should have used addFloat instead... ;)
Upvotes: 0
Views: 522