If ExcelReader reads a cell with the percenteage format
and no digits after the decimal separator (in France,
the ',' character), it returns "0%" whatever the cells
contains. This problem disapears as soon as there is a
digit, even if it is 0.
For example, a '15%' value returns '0%' but a '15,2%'
value returns '15,2%'.
Logged In: NO
If it's any use to anyone, I've also found this problem - I
fixed it by changing the code on line ~544 of reader.php:
It was:
case Spreadsheet_Excel_Reader_Type_RK:
case Spreadsheet_Excel_Reader_Type_RK2:
// echo
'Spreadsheet_Excel_Reader_Type_RK'."\n";
$row = ord($this->data[$spos]) |
ord($this->data[$spos+1])<<8;
$column = ord($this->data[$spos+2]) |
ord($this->data[$spos+3])<<8;
$rknum = $this->_GetInt4d($this->data,
$spos + 6);
$numValue = $this->_GetIEEE754($rknum);
// echo "<br />".$numValue."<br /> ";
if ($this->isDate($spos)) {
list($string, $raw) =
$this->createDate($numValue);
}else{
$raw = $numValue;
if
(isset($this->_columnsFormat[$column + 1])){
$this->curformat =
$this->_columnsFormat[$column + 1];
}
$string = sprintf($this->curformat,
$numValue * $this->multiplier);
//$this->addcell(RKRecord($r));
}
$this->addcell($row, $column, $string,
$raw);
// echo "Type_RK $row $column $string
$raw {$this->curformat}\n<br />";
break;
I've now got:
case Spreadsheet_Excel_Reader_Type_RK:
case Spreadsheet_Excel_Reader_Type_RK2:
// echo
'Spreadsheet_Excel_Reader_Type_RK'."\n";
$row = ord($this->data[$spos]) |
ord($this->data[$spos+1])<<8;
$column = ord($this->data[$spos+2]) |
ord($this->data[$spos+3])<<8;
$rknum = $this->_GetInt4d($this->data,
$spos + 6);
$numValue = $this->_GetIEEE754($rknum);
// echo "<br />".$numValue."<br /> ";
if ($this->isDate($spos)) {
list($string, $raw) =
$this->createDate($numValue);
} elseif($this->curformat == "%1.0f%%") {
$raw = $numValue;
$string = $raw;
}else{
$raw = $numValue;
if
(isset($this->_columnsFormat[$column + 1])){
$this->curformat =
$this->_columnsFormat[$column + 1];
}
$string = sprintf($this->curformat,
$numValue * $this->multiplier);
//$this->addcell(RKRecord($r));
}
$this->addcell($row, $column, $string,
$raw);
// echo "Type_RK $row $column $string
$raw {$this->curformat}\n<br />";
break;
This works for me, but I've not tested it thoughly...
David@cognite.net