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

DAYS函数计算错误 #54

Open
antporter opened this issue Jan 1, 2021 · 2 comments
Open

DAYS函数计算错误 #54

antporter opened this issue Jan 1, 2021 · 2 comments

Comments

@antporter
Copy link

	Cell A1 = cells.get("A1");
	A1.setValue("2021-01-02 23:59:59");
	Cell B1 = cells.get("B1");
	B1.setValue("2021-01-02 00:00:00");
	String formula = "=DAYS(A1,B1)";
	Cell C1 = cells.get("C1");
	C1.setFormula(formula);
	wb.calculateFormula(true);
	System.out.println(C1.getValue());

计算结果为:1
而实际结果应该为:0

@amjad-sahi
Copy link
Collaborator

amjad-sahi commented Jan 2, 2021

@antporter ,

如您所述,我能够重现该问题。 我发现DAYS函数有问题。 与MS Excel比较结果时,该函数将根据给定值执行不同的计算。 在我们的数据库中记录您问题的ID为“ CELLSJAVA-43381”的票证。 我们将研究它以尽快修复它。

顺便说一句,您也可以在相关的Aspose.Cells论坛(https://forum.aspose.com/c/cells/9 ) 上发布您的查询或问题,我们将在此处迅速为客户提供支持并找出问题(如果 找到)。

祝你有美好的一天!

@amjad-sahi
Copy link
Collaborator

@antporter,

请尝试使用我们的最新版本/修复程序:Aspose.Cells for Java v20.12.5

您的问题应得到解决。

让我们知道您的反馈。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants