Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quotation marks are need for string like "1e3", otherwise it will be regard as number 1000 #96

Closed
Keillion opened this issue Mar 22, 2022 · 2 comments

Comments

@Keillion
Copy link

Keillion commented Mar 22, 2022

var test = new {
    t = "1e3"
};

var serializer = new Serializer();
var str = serializer.Serialize(test);
System.Console.WriteLine(str);

actually print
t: 1e3

should be
t: "1e3"

It's an old bug from YamlDotNet. Seems no hope to be fixed in YamlDotNet.

@Keillion Keillion changed the title quotation marks are need for string like "1e3", else it will be regard as number 1000 Quotation marks are need for string like "1e3", otherwise it will be regard as number 1000 Mar 22, 2022
@xoofx
Copy link
Owner

xoofx commented Apr 12, 2022

It's an old bug from YamlDotNet. Seems no hope to be fixed in YamlDotNet.

I don't work much with YAML these days, so if you want a fix for this, you will have to make a pull-request for it.

@xoofx
Copy link
Owner

xoofx commented May 8, 2022

As I was fixing another bug, I was also in a good mood to try to fix this one. Should be fixed by commit 3105d16

@xoofx xoofx closed this as completed May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants