Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
JanisDavidsons committed May 19, 2023
1 parent ff78059 commit d65f933
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/PhpSpreadsheet/Calculation/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4908,7 +4908,7 @@ private function executeBinaryComparisonOperation($cellID, $operand1, $operand2,
} elseif ($useLowercaseFirstComparison) {
$result = $this->strcmpLowercaseFirst($operand1, $operand2) >= 0;
} else {
$result = strcmp($operand1, $operand2) >= 0;
$result = strcmp("$operand1", "$operand2") >= 0;
}

break;
Expand All @@ -4919,7 +4919,7 @@ private function executeBinaryComparisonOperation($cellID, $operand1, $operand2,
} elseif ($useLowercaseFirstComparison) {
$result = $this->strcmpLowercaseFirst($operand1, $operand2) <= 0;
} else {
$result = strcmp($operand1, $operand2) <= 0;
$result = strcmp("$operand1", $operand2) <= 0;
}

break;
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Calculation/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public static function ifCondition($condition)

if (!is_string($condition) || !in_array($condition[0], ['>', '<', '='])) {
if (!is_numeric($condition)) {
$condition = Calculation::wrapResult(strtoupper($condition));
$condition = Calculation::wrapResult(strtoupper("$condition"));
}

return str_replace('""""', '""', '=' . $condition);
Expand Down
2 changes: 1 addition & 1 deletion src/PhpSpreadsheet/Shared/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public static function convertEncoding($value, $to, $from)
*/
public static function countCharacters($value, $enc = 'UTF-8')
{
return mb_strlen($value, $enc);
return mb_strlen("$value", $enc);
}

/**
Expand Down

0 comments on commit d65f933

Please sign in to comment.