hyperformula icon indicating copy to clipboard operation
hyperformula copied to clipboard

Wrong output on certain time values

Open Kibarol opened this issue 3 years ago • 2 comments

Hello dear dev,

Description

We use Hyperformula to calculate elapsed time between two input values. The input are string formatted as : "hh:mm".

Used formula "=TEXT(B1-A1, "hh:mm")" Example : A = "13:25" B = "18:40" Expected result = "05:15"

PROBLEM : when the result is > 1h, if ending with 17 min, the output value is "..:16" instead of "..:17" A = " 14:00" B = "15:17" result should be "01:17" But actual output is "01:16". There must be a rounding issue.

Steps to reproduce

Try this codeSandbox demo when result should end with '...:17'

Demo

https://codesandbox.io/s/frosty-fire-7s49r3?file=/src/App.js

Your environment

  • HyperFormula version: "hyperformula": "^1.0.0",
  • Browser Name and version: Firefox v103.0 and Chrome Version 103.0.5060.134,
  • Operating System: MacOs (arm64)

Links none

Kibarol avatar Aug 04 '22 14:08 Kibarol

Hi @Kibarol, thank you for reporting. It seems to be a bug. Our team will investigate it shortly.

sequba avatar Aug 04 '22 14:08 sequba

Note to self: It seems that HyperFormula lacks unit tests for the time arithmetics. It must be fixed when working on this issue,

sequba avatar Aug 04 '22 14:08 sequba

Hi, any news concerning this issue?

Kibarol avatar Aug 19 '22 12:08 Kibarol

@Kibarol This bug is in the scope of the upcoming release that is expected within a couple of weeks.

sequba avatar Aug 19 '22 14:08 sequba

Hi @Kibarol

I'm more than happy to announce that @sequba just launched HyperFormula 2.1.0 where this issue is fixed. We are closing this issue as solved. If there is anything that won't work for you after updating please leave a comment.

AMBudnik avatar Sep 08 '22 12:09 AMBudnik