Skip to content

Think about aligning dtoa with JS behavior (also toFixed?) #1163

Open
@dcodeIO

Description

@dcodeIO

While implementing WASI's trace I noticed that we currently don't have the utility in place to omit trailing decimal .0s when converting a float to a string, like JS would do. As a result, WASI's trace prints those decimal places, while JS's trace does not.

trace("hello world", 3, 1, 2, 3.5);
// trace: hello world 1.0 2.0 3.5

This looks like it is not quite the same but similar in nature to toFixed, and looking into both instead of implementing workarounds might be ideal.

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