|
|
@ -815,7 +815,7 @@ func (f *File) calcCellValue(ctx *calcContext, sheet, cell string) (result formu
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (f *File) CalcFormulaValue(sheet, formula string) (result string, err error) {
|
|
|
|
func (f *File) calcFormulaValue(ctx *calcContext, sheet, formula string) (result string, err error) {
|
|
|
|
var (
|
|
|
|
var (
|
|
|
|
token formulaArg
|
|
|
|
token formulaArg
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -835,6 +835,17 @@ func (f *File) CalcFormulaValue(sheet, formula string) (result string, err error
|
|
|
|
result = token.Value()
|
|
|
|
result = token.Value()
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *File) CalcFormulaValue(sheet, formula string) (result string, err error) {
|
|
|
|
|
|
|
|
if result, err = f.calcFormulaValue(&calcContext{
|
|
|
|
|
|
|
|
entry: fmt.Sprintf("%s!%s", sheet, formula),
|
|
|
|
|
|
|
|
maxCalcIterations: getOptions().MaxCalcIterations,
|
|
|
|
|
|
|
|
iterations: make(map[string]uint),
|
|
|
|
|
|
|
|
iterationsCache: make(map[string]formulaArg),
|
|
|
|
|
|
|
|
}, sheet, formula); err != nil {
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// getPriority calculate arithmetic operator priority.
|
|
|
|
// getPriority calculate arithmetic operator priority.
|
|
|
|
func getPriority(token efp.Token) (pri int) {
|
|
|
|
func getPriority(token efp.Token) (pri int) {
|
|
|
|