mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-27 13:48:54 +08:00
spreadsheet: return empty values from sheet context
This is required as AVERAGE/AVERAGEA need to distinguish between empty and non-empty cells.
This commit is contained in:
parent
b056033c12
commit
e7da598399
@ -35,9 +35,8 @@ func (e *evalContext) Cell(ref string, ev formula.Evaluator) formula.Result {
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// Evaluating an empty cell returns a zero in Excel
|
|
||||||
if c.IsEmpty() {
|
if c.IsEmpty() {
|
||||||
return formula.MakeNumberResult(0)
|
return formula.MakeEmptyResult()
|
||||||
} else if c.IsNumber() {
|
} else if c.IsNumber() {
|
||||||
v, _ := c.GetValueAsNumber()
|
v, _ := c.GetValueAsNumber()
|
||||||
return formula.MakeNumberResult(v)
|
return formula.MakeNumberResult(v)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user