laravel - Stop PHP from rounding my numbers -


i've created invoice creator keeps rounding numbers. how stop this?

enter image description here

you see @ stukprijs = 206,61 , total 206 total needs 206,61 well.

my code:

public function makepdf(request $request){     $data = $request->all();      $data['totaal1'] = $data['stukprijs1'] * $data['aantal1']; 

i sent values form field post.

the app build in laravel.

you need both elements in multiplication floats if don't want php force round on result.

$data['totaal1'] = floatval($data['stukprijs1']) * floatval($data['aantal1']); 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -