Skip to content

2.3 hour duration gives 2h 17m (should be 2h 18m) #2978

Open
@afanasy

Description

@afanasy
//moment.js 2.11.2
moment.duration(0.3, 'h').minutes()
//18, as expected
moment.duration(2.3, 'h').minutes()
//17
//?!?

I understand that it's floating point problem, but can we work around this somehow, by not converting everything to milliseconds for instance?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions