v6 is still being developed, so this page is not yet complete. See https://github.com/angularsen/UnitsNet/issues/1200 for details.
Before upgrading to a new major version, first upgrade to the latest minor version and follow instructions on any build warnings by code marked as obsolete. This can make it easier to migrate.
The biggest change is removing support for decimal
quantities and converting Power
, Information
, BitRate
from decimal
to double
. The value holder type QuantityValue
is replaced by double
.
The motivation was to remove a lot of complexity in the code base. Decimal was initially added for precision issues, but this was later fixed by storing both value and unit. Only Information
still had any real benefit from decimal
, to better represent Bit
as an integer type and avoid rounding errors.
If there is still enough demand for representing bits as an integer or avoiding rounding errors in Information
and other quantities, then we can approach that in a simpler way like TimeSpan.Ticks
vs TimeSpan.TotalSeconds
.
If there is sufficient demand for supporting any number type like float
, decimal
or even Half
, then a more holistic approach is required using generics, which brings its own challenges.
NaN
, Inf
values for quantities with double
value type #1289decimal
support in quantities #1359, everything is now double
Power
, Information
, BitRate
from decimal
to double
#1195, #1353QuantityValue
, replaced with double
TValueType
from interfaces
IQuantity<TUnitType, out TValueType>
IValueQuantity<out TValueType>
IQuantity<TSelf, TUnitType, out TValueType>
to IQuantity<TSelf, TUnitType>
IArithmeticQuantity<TSelf, TUnitType, TValueType>
to IArithmeticQuantity<TSelf, TUnitType>
CoefficientOfThermalExpansion.InverseKelvin
, InverseDegreeCelsius
, InverseDegreeFahrenheit
HeatTransferCoefficient.BtuPerSquareFootDegreeFahrenheit
TemperatureGradient.DegreesCelsiusPerMeter
Density.GramsPerDeciliter
ElectricPotentialChangeRate.VoltsPerSecond
, VoltsPerMicrosecond
, VoltsPerMinute
, VoltsPerHour
FuelEfficiency.KilometersPerLiter
Speed.MetersPerMinute
Energy op_Multiply(Duration, Power)
moved from Power
to Duration
#1329None.
None.
Description of different kinds of incompatible changeshttps://learn.microsoft.com/en-us/dotnet/core/compatibility/8.0
📝 JSON unit definition schema changesBinary incompatible - When run against the new runtime or component, existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
Source incompatible - When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
Behavioral change - Existing code and binaries may behave differently at run time. If the new behavior is undesirable, existing code would need to be updated and recompiled.
"ValueType": "decimal"
used for decimal
quantitiesRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4