spadefoot / kohana-orm-leap

An ORM module for the Kohana PHP framework that is designed to work with all major databases.
http://spadefoot.github.io/kohana-orm-leap/
100 stars 25 forks source link

Handling of Decimal Fields are wrong! #78

Closed ghost closed 11 years ago

ghost commented 11 years ago

Following Line

 $value = number_format( (float) $value, $this->metadata['scale']);

should be turned into this:

$value = number_format( (float) $value, $this->metadata['scale'], '.', '');

The first statement produces the following:

input value: 5000.38 number_format output: 5,000.38

next line (settype) produces then this: 5 (because the comma is not handled correctly!)

bluesnowman commented 11 years ago

Thanks! Just updated it....