Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovered a strange bug. #1599

Closed
podmask opened this issue Aug 5, 2023 · 1 comment
Closed

Discovered a strange bug. #1599

podmask opened this issue Aug 5, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@podmask
Copy link

podmask commented Aug 5, 2023

Description
There is the code :

func TestMyTest(t *testing.T) {
	f, err := excelize.OpenFile("../test.xlsx")
	if err != nil {
		fmt.Println(err)
		return
	}
	defer f.Close()

	f.SetCellValue("Sheet1", "D24", "2001")
	f.SetCellFormula("Sheet1", "D25", `IF(D24<>"","、"&D24,"")`)
	f.SetCellFormula("Sheet1", "E25", `IF(E24<>"","、"&E24,"")`)
	f.SetCellFormula("Sheet1", "B27", `IF(D25&E25<>"",D25&E25,"")`)

	value, err := f.CalcCellValue("Sheet1", "D25")
	if err != nil {
		fmt.Println(err)
		return
	}
	t.Log("D25:", value)

	value, err = f.CalcCellValue("Sheet1", "E25")
	if err != nil {
		fmt.Println(err)
		return
	}
	t.Log("E25:", value)
	value, err = f.CalcCellValue("Sheet1", "B27")
	if err != nil {
		fmt.Println("B27 err:", err)
	}
	t.Log("B27:", value)
}

Describe the results you received:

Running tool: C:\golang\go\bin\go.exe test -timeout 30s -run ^TestMyTest$ excelizer/testing -v

=== RUN   TestMyTest
    d:\DEV\go-dev\excelizer\testing\excel_test.go:112: D25: 、2001
    d:\DEV\go-dev\excelizer\testing\excel_test.go:119: E25:
B27 err: strconv.ParseBool: parsing "、2001FALSE": invalid syntax
    d:\DEV\go-dev\excelizer\testing\excel_test.go:124: B27: #VALUE!
--- PASS: TestMyTest (0.00s)
PASS
ok  	excelizer/testing	0.332s

Describe the results you expected:

B27: 、2001

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

@xuri xuri added bug Something isn't working in progress Working in progress labels Aug 5, 2023
@xuri xuri closed this as completed in eb17590 Aug 5, 2023
@xuri
Copy link
Member

xuri commented Aug 5, 2023

Thanks for your issue. I have fixed this issue, please try to upgrade the master branch code, and this patch will be released in the next version.

@xuri xuri removed the in progress Working in progress label Aug 5, 2023
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
- Fix basic arithmetic operator priority issues
- Support apply date and time number format with 52 languages: Estonian, Faroese, Filipino, Finnish, Frisian, Fulah, Galician, Georgian, Greek, Greenlandic, Guarani, Gujarati, Hausa, Hawaiian, Hebrew, Hindi, Hungarian, Icelandic, Igbo, Indonesian, Inuktitut, Kannada, Kashmiri, Kazakh, Khmer, Kiche, Kinyarwanda, Kiswahili, Konkani, Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malay, Malayalam, Maltese, Maori, Mapudungun, Marathi, Mohawk, Morocco, Nepali, Nigeria, Norwegian, Occitan, Odia, Oromo, Pashto and Syllabics
- Support apply the Chinese weekdays' number formats
- Update the unit test and dependencies modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants