Skip to content

Fix tests running in cultures using different cultures#837

Merged
EdwardCooke merged 3 commits into
aaubry:masterfrom
EdwardCooke:ec-792-testsinnonenglish
Aug 24, 2023
Merged

Fix tests running in cultures using different cultures#837
EdwardCooke merged 3 commits into
aaubry:masterfrom
EdwardCooke:ec-792-testsinnonenglish

Conversation

@EdwardCooke

Copy link
Copy Markdown
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

aaubry commented Aug 28, 2023

Copy link
Copy Markdown
Owner

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