Jump to content

decimal issue. cant seem to save to db


codetard

Recommended Posts

i am using a joomla component called estate manager. part of the display shows how many rooms  a house has. the developer coded it so that this field is a interger. I need it to be a decimal becuase where I live, the  room numbering system accounts also for 'half rooms'  ex. 5.5 rooms.


well i logged in phpmyadmin, and changed the field type to 'decimal' and set it to 10,1

probblem is though, when i enter 5.5. in the admin of the application, it does not save correctly. it always saves as 5.0


also i tried to enter 4.5 and it saved as 4.0


I also then edited the data directly in phpMyAdmin, and it saved and displays fine as 5.5. in the frontend.


any tips for me?
Link to comment
https://forums.phpfreaks.com/topic/27090-decimal-issue-cant-seem-to-save-to-db/
Share on other sites

ah nevermind, the n00b answered his own question:

                      /* $obj->rooms                                = intval(mosGetParam($_POST,'rooms',0)); */

                          $obj->rooms                                = doubleval(mosGetParam($_POST,'rooms',0.00));


peace

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.