Skip to content

Conversions from milliseconds are rounded #140

Open

Description

@gmattie
ms("2.5 hrs") // 9000000
ms("9000000") // 3h
ms("9000000", { long: true ) // 3 hours

The above code returns "3h" or "3 hours" when a total of 2.5 hrs in milliseconds is parsed.

If there are technical limitations to returning accurate string representations, it would be ideal to provide an example and explanation in the repository readme.md.

Activity

  1. ianmcderp commented on Jul 23, 2020

    @ianmcderp

    This issue would be fixed by merging the CR from #125.

  2. david-gonzalez-pnw commented on Jun 10, 2021

    @david-gonzalez-pnw

    Bump on this!! This is a pretty decent bug. It caused us to loose a couple of hours troubleshooting our custom CI system where we couldn't figure out why calculated timeouts weren't being respected (things were timing out earlier).

    > ms('1h')
    3600000
    > ms('73m')
    4380000
    > ms(4380000)
    '1h'
    
  3. kud commented on Sep 19, 2023

    @kud

    Yeah everything is rounded.

    screenshot-2023-09-19-16-51-11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions