Re: PHP 4.2.2 Float->Mysql addition problem
| From: | Barry | Date: | Fri, 03 Feb 2006 12:42:59 +0000 |
| Subject: | Re: PHP 4.2.2 Float->Mysql addition problem | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229802@lists.php.net to get a copy of this message | ||
Barry wrote:
Andrei wrote:oh well, at least it's calculating ^-^ Thanks for help :) Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)Thanks Andy sounds great. Changed DB to decimal 10.2 Tried it, but using bcadd i get a value of 0.00. If you have som sample code lying around somewhere that would be great, or do you know what happened? Barry No problem anymore. solved it. but parsing it to an other function it doesnt work.When working with floats with php/mysql I had problems too... When summing amounts I had errors so my solution was using decimal (20, 10) type into mysql for storing amounts and when using sums in php I used bc functions. This way u get exact calculations (depending on bcscale() parameter.