qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
17.62k stars 1.68k forks source link

The brackets will be missing when setting up the arithmetic formula with brackets. #1913

Closed iciness closed 1 month ago

iciness commented 1 month ago

Description

The brackets will be missing when setting up the arithmetic formula with brackets.

Steps to reproduce the issue:

xlsx.SetCellFormula("Sheet1", "I3", "=(H3-800)*20%")
xlsx.UpdateLinkedValue()

Describe the results you received: After excel opens the file, the formula of i3 becomes = H3-800 * 20%

Describe the results you expected: The brackets in the formula are not lost

Output of go version:

go version go1.22.3 windows/amd64

Excelize version or commit ID:

v2.8.1

Environment details (OS, Microsoft Excel™ version, physical, etc.):

windows 11 pro 23H2 22631.3672 execl 2405 Build 16.0.17628.20006 64bit

iciness commented 1 month ago

template.xlsx Template files 20240603_172116_88_89.xlsx Generated files