Note that there are some explanatory texts on larger screens.

plurals
  1. POValue in array getting un rounded
    primarykey
    data
    text
    <p>Here is the code within a method of a class:</p> <pre><code> $this-&gt;p($result);//die(); $this-&gt;spreadSheet($result); //die(); $this-&gt;p($result);die(); </code></pre> <p>Result of first print call(this->p)</p> <pre><code>Array ( [0] =&gt; Array ( [BLOCK_ID] =&gt; 537-14547 [SawnOn] =&gt; Gang saw [ORIG_VOLUME_BRUT] =&gt; 179.67 [ORIG_VOLUME_NET] =&gt; 103.38 [COUTS_TOTAUX] =&gt; 2413.92 [COUTS_TRANSPORT] =&gt; 0 [SLABCOUNT] =&gt; 20 [totalSlabVolume] =&gt; 117.48 [totalSurfaceArea] =&gt; 1127.78 [totalValue] =&gt; 9563.56 [RECEPTION_DATE] =&gt; 03/22/2013 [1st Quality] =&gt; 100 [Second Quality] =&gt; 0 [Standard Slab] =&gt; 0 ) [1] =&gt; Array ( [BLOCK_ID] =&gt; 618-11523 [SawnOn] =&gt; Gang saw [ORIG_VOLUME_BRUT] =&gt; 241.46 [ORIG_VOLUME_NET] =&gt; 171 [COUTS_TOTAUX] =&gt; 11858.85 [COUTS_TRANSPORT] =&gt; 0 [SLABCOUNT] =&gt; 56 [totalSlabVolume] =&gt; 143.44 [totalSurfaceArea] =&gt; 2295.03 [totalValue] =&gt; 21687.43 [RECEPTION_DATE] =&gt; 03/29/2013 [1st Quality] =&gt; 91.07 [Second Quality] =&gt; 7.14 [Standard Slab] =&gt; 1.79 ) [2] =&gt; Array ( [BLOCK_ID] =&gt; 237-14593 [SawnOn] =&gt; Gang saw [ORIG_VOLUME_BRUT] =&gt; 312.5 [ORIG_VOLUME_NET] =&gt; 260.23 [COUTS_TOTAUX] =&gt; 12061.66 [COUTS_TRANSPORT] =&gt; 0 [SLABCOUNT] =&gt; 40 [totalSlabVolume] =&gt; 160.27 [totalSurfaceArea] =&gt; 1538.55 [totalValue] =&gt; 14016.18 [RECEPTION_DATE] =&gt; 03/22/2013 [1st Quality] =&gt; 0 [Second Quality] =&gt; 17.5 [Standard Slab] =&gt; 82.5 ) ) </code></pre> <p>Result of second print out:</p> <pre><code>Array ( [0] =&gt; Array ( [BLOCK_ID] =&gt; 537-14547 [SawnOn] =&gt; Gang saw [ORIG_VOLUME_BRUT] =&gt; 179.67 [ORIG_VOLUME_NET] =&gt; 103.38 [COUTS_TOTAUX] =&gt; 2413.92 [COUTS_TRANSPORT] =&gt; 0 [SLABCOUNT] =&gt; 20 [totalSlabVolume] =&gt; 117.48 [totalSurfaceArea] =&gt; 1127.78 [totalValue] =&gt; 9563.56 [RECEPTION_DATE] =&gt; 03/22/2013 [1st Quality] =&gt; 100 [Second Quality] =&gt; 0 [Standard Slab] =&gt; 0 ) [1] =&gt; Array ( [BLOCK_ID] =&gt; 618-11523 [SawnOn] =&gt; Gang saw [ORIG_VOLUME_BRUT] =&gt; 241.46 [ORIG_VOLUME_NET] =&gt; 171 [COUTS_TOTAUX] =&gt; 11858.85 [COUTS_TRANSPORT] =&gt; 0 [SLABCOUNT] =&gt; 56 [totalSlabVolume] =&gt; 143.44 [totalSurfaceArea] =&gt; 2295.03 [totalValue] =&gt; 21687.43 [RECEPTION_DATE] =&gt; 03/29/2013 [1st Quality] =&gt; 91.06999999999999 [Second Quality] =&gt; 7.14 [Standard Slab] =&gt; 1.79 ) [2] =&gt; Array ( [BLOCK_ID] =&gt; 237-14593 [SawnOn] =&gt; Gang saw [ORIG_VOLUME_BRUT] =&gt; 312.5 [ORIG_VOLUME_NET] =&gt; 260.23 [COUTS_TOTAUX] =&gt; 12061.66 [COUTS_TRANSPORT] =&gt; 0 [SLABCOUNT] =&gt; 40 [totalSlabVolume] =&gt; 160.27 [totalSurfaceArea] =&gt; 1538.55 [totalValue] =&gt; 14016.18 [RECEPTION_DATE] =&gt; 03/22/2013 [1st Quality] =&gt; 0 [Second Quality] =&gt; 17.5 [Standard Slab] =&gt; 82.5 ) </code></pre> <p>)</p> <p>Now see the value for 1st quality in Array[1] of second output. It has changed from 91.07 to 91.0699999999. What could have possibly caused this? </p> <p>Here is the code for the 2 methods called in the code above:</p> <pre><code> function spreadSheet($blocks) { $this-&gt;excel-&gt;getProperties()-&gt;setCreator("Maper") -&gt;setLastModifiedBy("Maper") -&gt;setTitle("Maper") -&gt;setSubject("Maper") -&gt;setDescription("Maper") -&gt;setKeywords("Maper") -&gt;setCategory("Maper"); $i=1; $col='A'; $columns = $this-&gt;tableHeadings; foreach ($columns as $column) { $this-&gt;excel-&gt;getActiveSheet()-&gt;setCellValue($col++ . $i, $column); } foreach($blocks as $columns) { $i++; $col = 'A'; foreach($columns as $column) { if($col=='A')$sheetName=$column; $this-&gt;excel-&gt;getActiveSheet()-&gt;setCellValue($col++ . $i, $column); } $this-&gt;_addSheet($sheetName); $this-&gt;excel-&gt;getActiveSheet()-&gt;getCell('A'.$i)-&gt;getHyperlink()-&gt;setUrl("sheet://'".$sheetName."'!A1"); } $this-&gt;excel-&gt;getActiveSheet()-&gt;setTitle('Blocks'); $this-&gt;setStyles(); //$this-&gt;_forceSpreadsheetDownload(); $this-&gt;_saveSpreadsheet(); } </code></pre> <p>the p method:</p> <pre><code> function p($arr) { echo"&lt;pre&gt;"; print_r($arr); echo"&lt;/pre&gt;"; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload