YamlNumberHandling Enum
Definition
Specifies how YamlSerializer coerces numeric scalars when binding to integral targets.
public enum YamlNumberHandling
- Extension Methods
Fields
Strict = 0Reject a non-integral or out-of-range numeric source when binding to an integer target. This is the default.
AllowFloatToInteger = 1Allow 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
| Product | Versions |
|---|---|
| .NET | 8, 10 |