Skip to content

format() produces output that parse() cannot parse back (roundtrip failure with large numbers) #284

@dsecurity49

Description

@dsecurity49

Bug Report

Description

format() returns values in scientific notation for very large numbers,
but parse() cannot handle scientific notation — returning NaN.
This breaks the roundtrip contract between the two functions.

Steps to Reproduce

import { ms } from 'ms';

const out = ms(Number.MAX_VALUE);
console.log(out);        // "5.696545792019405e+297y"
console.log(ms(out));    // NaN — cannot parse its own output
Expected Behavior
Either:
format() should not produce scientific notation output, OR
parse() should handle scientific notation input
Actual Behavior
format() outputs 5.696545792019405e+297y
parse() returns NaN for that same string
Environment
ms version: 4.0.0
Node.js on Android/Termux

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