php-db | 2001011
Date: 01/03/01
- Next message: Guridi, Jose: "[PHP-DB] Oracle Spanish NLS_LANG ORA_NLS33"
- Previous message: Tyson Lloyd Thwaites: "[PHP-DB] IBM DB2 speed issues: why so slow?"
- In reply to: Mattias Johansson: "[PHP-DB] Setting integers with decimals into a cell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Mattias,
At 16:18 31/12/00, Mattias Johansson wrote:
>I have almost finished my evil new-years-eve project, but I have run into
>the last problem of them all. You see - I have a variable that usually
>produces a number like this: 4.17349837364732. I want this to be 4.17 and
>set it into a MySQL database. How can this be done? I currently have the
>field in question set to TINYINT, but that does not seem to work. Can anyone
>please help me with this little problem?
Use the round function in PHP:
http://www.php.net/manual/function.round.php
Or even better, use the MySQL datatype FLOAT(4,2) which will automatically
convert inserted numbers to two decimal places.
Regards,
Glen
-----------------------------------------------------
Design Solution Limited
t: +44 (0)1502 513008
f: +44 (0)1502 588622
e: info <email protected>
w: http://www.designsolution.co.uk
Nouvotech House, Harbour Road,
Oulton Broad, Suffolk, NR32 3LZ, UK
-----------------------------------------------------
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Guridi, Jose: "[PHP-DB] Oracle Spanish NLS_LANG ORA_NLS33"
- Previous message: Tyson Lloyd Thwaites: "[PHP-DB] IBM DB2 speed issues: why so slow?"
- In reply to: Mattias Johansson: "[PHP-DB] Setting integers with decimals into a cell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

