Skip to main content
QuantityTypes.Dynamic package icon

QuantityTypes.Dynamic

# QuantityTypes ## Features - [Strongly typed](http://en.wikipedia.org/wiki/Strong_typing) arithmetics of [physical quantities](http://en.wikipedia.org/wiki/Physical_quantity) - Implemented as [value types](http://msdn.microsoft.com/en-us/library/s1ax56ch.aspx) - Parsing from strings - Formatting to strings - Operators - Unit conversion - Extendable (create more quantity types, add units) - Configurable (set default units for parsing and formatting) - [NuGet package](https://www.nuget.org/packages/QuantityTypes) ## Examples ``` csharp Length s = 100 * Length.Metre; Time t = 9.58 * Time.Second; Velocity v = s / t; Console.WriteLine(v); Console.WriteLine(v.ToString("0.00[km/h]")); Console.WriteLine("Speed: {0:0.00[!km/h] kmph}", v); Mass m = Mass.Parse("92 kg"); double massInPounds = m / Mass.Pound; Temperature temp = 100 * Temperature.DegreeCelsius; double tempInFahrenheit = temp.ConvertTo(Temperature.DegreeFahrenheit); ``` # Change Log ## 5.0.0 ### Added - GitHub workflows (#113) - Publish to GitHub packages (#114) - Examples with System.Text.Json (#108) ### Removed - net45 target (#109) ## 4.0.0 ### Added - Imperial units - NaN, PositiveInfinity and NegativeInfinity quantities (#83) - LinearMassDensity (#82) - Scandinavian mile length unit (#88) - Custom length example (#89) ### Changed - Target netstandard1.3 and net45 (#97) ### Fixed - Null reference exception in QuantityJsonConverter (#85) - Migrate projects to netstandard (#94) - TryParse of `null` should return `false` (#96) ## 3.0.1 ### Changed - IQuantity depends on IXmlSerializable - changed XML serialization (#62) - Xml serialization without units (#66) - Moved CSV functionality to QuantityTypes.Csv (#67) - Moved dynamic types to separate project (#71) - Signing the QuantityTypes assembly (#51) ### Added - t/m^3 density unit (#80) - TimeSpan extension methods (#43) - Format with conversion, without showing unit (#52) - Moment type (#11) ### Fixed - lb/gal unit (#1) ## 2.0.1 ### Changed - Target netstandard 1.0 ## 2.0.0 ### Changed - Target netstandard 1.1 ## 1.1.0 ### Added - Torque units: N*cm, N*mm (#8) - Use GitHub as source server (#12) - Unit prefixes and operator overloads for electrical units - Lighting calculations ### Changed - Refactor UnitProvider.RegisterUnits to extension methods (#6) - Rename DegreeKelvin to Kelvin and delete "degK" unit (#30) - Case sensitive unit prefixes - Switch PCL project to profile 328 ### Fixed - Support parsing of "'" units (#20)

Total Downloads
4.1K
4,134
Published
May 29, 2022
Latest stable version

Install

.NET CLI
dotnet add package QuantityTypes.Dynamic --version 4.99.2
Package Manager Console
Install-Package QuantityTypes.Dynamic -Version 4.99.2
PackageReference
<PackageReference Include="QuantityTypes.Dynamic" Version="4.99.2" />

Frameworks

.NETStandard1.3

Dependencies

NETStandard.Library
.NETStandard1.3
[1.6.1, )

Adoption guide

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

How to read this guidance

Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.

Useful next steps

Move from package metadata to a concrete selection or review workflow.