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

Fix tests running in cultures using different cultures #837

Merged
merged 3 commits into from
Aug 24, 2023

Conversation

EdwardCooke
Copy link
Collaborator

Fixes #792

Also adds the ability to specify the number format for the project, defaults to yaml standard.

To specify the number format when serializing or deserializing, use a custom YamlFormatter, setting the NumberFormat property to what you want, for example, CultureInfo.CurrentCulture.NumberFormat and pass that in to the builders with the WithYamlFormatter method.

Full example, to use the current culture's number format,

var serializer = new SerializerBuilder()
    .WithYamlFormatter(
        new YamlFormatter
        {
            NumberFormat = CultureInfo.CurrentCulture.NumberFormat
        }
    ).Build();

@EdwardCooke EdwardCooke merged commit a6845eb into aaubry:master Aug 24, 2023
@aaubry
Copy link
Owner

aaubry commented Aug 28, 2023

This feature has been released in version 13.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tests failing if current Culture setting does not use decimal point separator
2 participants