Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Type casting error DOUBLE

propel
Discussion topic

Back to topic list

Type casting error DOUBLE

Reply

Author Alessandro SS <sancwb at gmail dot com>
Full name Alessandro SS <sancwb at gmail dot com>
Date 2007-11-16 14:20:39 PST
Message Problems with double type column in database MySQL

Schema:
{{{
  <table name="cotacao">
    <column name="valor" type="DOUBLE" size="10" scale="3"/>
  </table>
}}}

Code:

{{{
 $cotacao = new Cotacao();
 $cotacao->setValor(2.5);
 $cotacao->save();
}}}

It saves ok! But if you check the table it saves the field
with the value 2.000 and not 2.500
Attachments

« Previous message in topic | 1 of 2 | Next message in topic »

Messages

Show all messages in topic

Type casting error DOUBLE Alessandro SS <sancwb at gmail dot com> Alessandro SS <sancwb at gmail dot com> 2007-11-16 14:20:39 PST
     Re: [propel-dev] Type casting error DOUBLE Noah Fontes <impl at cynigram dot com> Noah Fontes <impl at cynigram dot com> 2007-11-16 18:32:10 PST
Messages per page: