Skip to content

float decimal places precision in node #761

@hsilva7

Description

@hsilva7

I am trying to dump a node into a file with float values.

YAML::Node node;
node["Map"]["FloatValue"] = 123.456;

std::ofstream fout("file.yaml");
fout << node;

The output that I get is

Map:
    FloatValue: 123.456001

Is there anyway I can set the precision in a node?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions