php - Value in array getting un rounded -


here code within method of class:

        $this->p($result);//die();         $this->spreadsheet($result);  //die();         $this->p($result);die(); 

result of first print call(this->p)

array         (             [0] => array                 (                     [block_id] => 537-14547                     [sawnon] => gang saw                     [orig_volume_brut] => 179.67                     [orig_volume_net] => 103.38                     [couts_totaux] => 2413.92                     [couts_transport] => 0                     [slabcount] => 20                     [totalslabvolume] => 117.48                     [totalsurfacearea] => 1127.78                     [totalvalue] => 9563.56                     [reception_date] => 03/22/2013                     [1st quality] => 100                     [second quality] => 0                     [standard slab] => 0                 )              [1] => array                 (                     [block_id] => 618-11523                     [sawnon] => gang saw                     [orig_volume_brut] => 241.46                     [orig_volume_net] => 171                     [couts_totaux] => 11858.85                     [couts_transport] => 0                     [slabcount] => 56                     [totalslabvolume] => 143.44                     [totalsurfacearea] => 2295.03                     [totalvalue] => 21687.43                     [reception_date] => 03/29/2013                     [1st quality] => 91.07                     [second quality] => 7.14                     [standard slab] => 1.79                 )              [2] => array                 (                     [block_id] => 237-14593                     [sawnon] => gang saw                     [orig_volume_brut] => 312.5                     [orig_volume_net] => 260.23                     [couts_totaux] => 12061.66                     [couts_transport] => 0                     [slabcount] => 40                     [totalslabvolume] => 160.27                     [totalsurfacearea] => 1538.55                     [totalvalue] => 14016.18                     [reception_date] => 03/22/2013                     [1st quality] => 0                     [second quality] => 17.5                     [standard slab] => 82.5                 )          ) 

result of second print out:

array ( [0] => array     (         [block_id] => 537-14547         [sawnon] => gang saw         [orig_volume_brut] => 179.67         [orig_volume_net] => 103.38         [couts_totaux] => 2413.92         [couts_transport] => 0         [slabcount] => 20         [totalslabvolume] => 117.48         [totalsurfacearea] => 1127.78         [totalvalue] => 9563.56         [reception_date] => 03/22/2013         [1st quality] => 100         [second quality] => 0         [standard slab] => 0     )  [1] => array     (         [block_id] => 618-11523         [sawnon] => gang saw         [orig_volume_brut] => 241.46         [orig_volume_net] => 171         [couts_totaux] => 11858.85         [couts_transport] => 0         [slabcount] => 56         [totalslabvolume] => 143.44         [totalsurfacearea] => 2295.03         [totalvalue] => 21687.43         [reception_date] => 03/29/2013         [1st quality] => 91.06999999999999         [second quality] => 7.14         [standard slab] => 1.79     )  [2] => array     (         [block_id] => 237-14593         [sawnon] => gang saw         [orig_volume_brut] => 312.5         [orig_volume_net] => 260.23         [couts_totaux] => 12061.66         [couts_transport] => 0         [slabcount] => 40         [totalslabvolume] => 160.27         [totalsurfacearea] => 1538.55         [totalvalue] => 14016.18         [reception_date] => 03/22/2013         [1st quality] => 0         [second quality] => 17.5         [standard slab] => 82.5     ) 

)

now see value 1st quality in array[1] of second output. has changed 91.07 91.0699999999. have possibly caused this?

here code 2 methods called in code above:

    function spreadsheet($blocks) {     $this->excel->getproperties()->setcreator("maper")         ->setlastmodifiedby("maper")         ->settitle("maper")         ->setsubject("maper")         ->setdescription("maper")         ->setkeywords("maper")         ->setcategory("maper");      $i=1;     $col='a';     $columns = $this->tableheadings;     foreach ($columns $column) {         $this->excel->getactivesheet()->setcellvalue($col++ . $i, $column);     }       foreach($blocks $columns)     {         $i++;         $col = 'a';         foreach($columns $column)         {             if($col=='a')$sheetname=$column;             $this->excel->getactivesheet()->setcellvalue($col++ . $i, $column);          }        $this->_addsheet($sheetname);         $this->excel->getactivesheet()->getcell('a'.$i)->gethyperlink()->seturl("sheet://'".$sheetname."'!a1");      }     $this->excel->getactivesheet()->settitle('blocks');     $this->setstyles();     //$this->_forcespreadsheetdownload();     $this->_savespreadsheet();   } 

the p method:

    function p($arr) {     echo"<pre>";     print_r($arr);     echo"</pre>"; } 


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -