PHP Classes

numbers as string

Recommend this page to a friend!

      SimpleXLSX  >  All threads  >  numbers as string  >  (Un) Subscribe thread alerts  
Subject:numbers as string
Summary:read number as string
Messages:3
Author:Herry Raditya Wibowo
Date:2017-03-31 04:31:37
 

  1. numbers as string   Reply   Report abuse  
Picture of Herry Raditya Wibowo Herry Raditya Wibowo - 2017-03-31 04:31:37
How to read cell as string?
My cells have "0079" and "-3.00", and it reads as 79 and -3 respectively. I need to be able to read them as "0079" and "-3.00".

Please advise.
:rherry

  2. Re: numbers as string   Reply   Report abuse  
Picture of Sergey Shuchkin Sergey Shuchkin - 2017-03-31 05:33:46 - In reply to message 1 from Herry Raditya Wibowo
try $xlsx->rowsEx()

  3. Re: numbers as string   Reply   Report abuse  
Picture of Herry Raditya Wibowo Herry Raditya Wibowo - 2017-04-01 09:40:03 - In reply to message 2 from Sergey Shuchkin
Hi,
My php converts the rows into json, and returned to be displayed in a table.
When I use $xlsx->rows(), I have arrays of values returned to me.
[Array(8), Array(8)], where one array consists of
Array(8)
0:""
1:"Customer Part No.:"
2:"30001150"
3:""
4:""
5:"Power"
6:-3
7:""
The table can display it properly, only the -3 value supposed to be -3.00.

However, when I use $xlsx->rowsEx(), the one returned to me were array of objects, thus the contents of the row in question became:
Object
f:"IF(ISERROR(VLOOKUP($C$11,MASTERITEM,4,FALSE)),"",VLOOKUP($C$11,MASTERITEM,4,FALSE))"
format:"0.00"
href:""
name:"G11"
type:""
value:-3

When I do print_r($xlsx->rowsEx()), I got:
Array ( [0] => Array ( [0] => Array ( [type] => [name] => A1 [value] => [href] => [f] => [format] => ) [1] => Array ( [type] => [name] => B1 [value] => [href] => [f] => [format] => ) [2] => Array ( [type] => s [name] => C1 [value] => [href] => [f] => [format] => General ) [3...

How should I use rowsEx()?

Please advise,
:rherry