Table of Contents

YamlNumberHandling Enum

Definition

Namespace
Bodu.Text.Yaml
Assembly
Bodu.Text.Yaml.dll
Package
Bodu.Text.Yaml 1.0.0
Source
YamlNumberHandling.cs

Specifies how YamlSerializer coerces numeric scalars when binding to integral targets.

public enum YamlNumberHandling
Extension Methods

Fields

Strict = 0

Reject a non-integral or out-of-range numeric source when binding to an integer target. This is the default.

AllowFloatToInteger = 1

Allow a floating-point source to be truncated toward zero when binding to an integer target.

Remarks

The default is Strict, under which a floating-point scalar must be exactly integral and in range to bind to an integer target. AllowFloatToInteger opts in to the lenient behavior of truncating a fractional value, which discards data and should be selected deliberately.

Applies to

ProductVersions
.NET8, 10