Have a look at this section.
They used decimal for the database and cast it to a double in the getter method
public function getPrice()
{
//Convert the value to double before be used
return (double) $this->price;
}
mysql> desc products;
+------------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| product_types_id | int(10) unsigned | NO | MUL | NULL | |
| name | varchar(70) | NO | | NULL | |
| price | decimal(16,2) | NO | | NULL | |
| active | char(1) | YES | | NULL | |
+------------------+------------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
I'm not sure if this answeres your question.
It would be great if you could explain your problem a little more in detail.