I asked this question on StackOverflow but I'm not getting any response there, so I'm posting it here hoping that someone can shed some light on this.
I noticed that a DB insert with floating numbers using HHVM is cutting off the decimal part. In the example below, the value actually stored in the MySQL database is 7.00. The MySQL field is a decimal field.
DB::table('test')->insert([
[
'name' => 'Some name',
'description' => 'Some description',
'price' => 7.99
]);
When using PHP instead of HHVM, the value is stored correctly. Also, when replacing 7.99 with '7.99' (as a string) using HHVM, the value is also stored correctly.
Is this an incompatibility between Laravel's insert() function and HHVM, or am I overlooking something here?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community