Hi,
When dealing with a large number of information, it seems useful to save all information in the same table with the entity rather then having the entity fieldable. In other words I would prefer to add entity properties rather then adding them as fields, trying to avoid unnecessary joins.
Having this said, while playing with this module I tried to add a Decimal property to my test entity for storing thinks like quantity and price. But it looks like the Decimal property is actually creating a float field in the table, not a decimal.
I would like to have the ability to implement an actual decimal property with a properly configured behavior. Can someone help with some examples?
Any help is appreciated.
Thanks!
Comments
Comment #1
mihai_brb commentedI figured it out by following some example code available in some issues, mainly http://drupal.org/node/1650990
Comment #2
bojanz commentedIf you are not using bcmath to do the value manipulations, then your decimal field will still be treated as a float in PHP (since PHP has no decimal data type)
Keep that in mind.
Comment #3
mihai_brb commentedThanks,
The problem is the mysql handling for float. Saving for example product price as a float is a really bad idea.
Mihai