forked from p30928647/excelize
Fix the formula calculation result issue of the OR function (#1374)
Co-authored-by: gonghaibin <gonghaibin@qq.com>
This commit is contained in:
parent
2df615fa28
commit
f843a9ea56
3
calc.go
3
calc.go
|
@ -11623,6 +11623,9 @@ func (fn *formulaFuncs) OR(argsList *list.List) formulaArg {
|
|||
return newErrorFormulaArg(formulaErrorVALUE, formulaErrorVALUE)
|
||||
case ArgNumber:
|
||||
or = token.Number != 0
|
||||
if or {
|
||||
return newStringFormulaArg(strings.ToUpper(strconv.FormatBool(or)))
|
||||
}
|
||||
case ArgMatrix:
|
||||
// TODO
|
||||
return newErrorFormulaArg(formulaErrorVALUE, formulaErrorVALUE)
|
||||
|
|
|
@ -1421,6 +1421,7 @@ func TestCalcCellValue(t *testing.T) {
|
|||
"=OR(0)": "FALSE",
|
||||
"=OR(1=2,2=2)": "TRUE",
|
||||
"=OR(1=2,2=3)": "FALSE",
|
||||
"=OR(1=1,2=3)": "TRUE",
|
||||
"=OR(\"TRUE\",\"FALSE\")": "TRUE",
|
||||
// SWITCH
|
||||
"=SWITCH(1,1,\"A\",2,\"B\",3,\"C\",\"N\")": "A",
|
||||
|
|
Loading…
Reference in New Issue