ktsu.Semantics.Quantities.Decimal 5.12.0

Prefix Reserved
dotnet add package ktsu.Semantics.Quantities.Decimal --version 5.12.0
                    
NuGet\Install-Package ktsu.Semantics.Quantities.Decimal -Version 5.12.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ktsu.Semantics.Quantities.Decimal" Version="5.12.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ktsu.Semantics.Quantities.Decimal" Version="5.12.0" />
                    
Directory.Packages.props
<PackageReference Include="ktsu.Semantics.Quantities.Decimal" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ktsu.Semantics.Quantities.Decimal --version 5.12.0
                    
#r "nuget: ktsu.Semantics.Quantities.Decimal, 5.12.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ktsu.Semantics.Quantities.Decimal@5.12.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ktsu.Semantics.Quantities.Decimal&version=5.12.0
                    
Install as a Cake Addin
#tool nuget:?package=ktsu.Semantics.Quantities.Decimal&version=5.12.0
                    
Install as a Cake Tool

ktsu.Semantics.Quantities.Decimal

Storage-type aliases that bind every ktsu.Semantics.Quantities type to decimal, so you write Mass instead of Mass<decimal>, project-wide.

License NuGet Version NuGet Version NuGet Downloads GitHub commit activity GitHub contributors GitHub Actions Workflow Status

ktsu.Semantics.Quantities.Decimal is a satellite of ktsu.Semantics.Quantities in the ktsu.Semantics family. Read the core package README first for the quantity API itself.

Introduction

Every quantity in ktsu.Semantics.Quantities is generic over its numeric storage type, so you normally write Mass<decimal>, Speed<decimal>, and so on. If a project uses one storage type throughout, that generic argument is noise.

This package is props-only. It ships no assembly, just a build props file that injects one C# global-using alias per quantity, binding each open generic type to decimal. Reference it and you can write Mass, Speed, Force3D with no generic argument, and every quantity resolves to its decimal form. The aliases are real Mass<decimal> (and so on), so they interoperate with the entire API with no conversion.

Installing this package also pulls in the matching version of ktsu.Semantics.Quantities as a dependency, so it is the only reference you need.

Installation

Package Manager Console

Install-Package ktsu.Semantics.Quantities.Decimal

.NET CLI

dotnet add package ktsu.Semantics.Quantities.Decimal

Package Reference

<PackageReference Include="ktsu.Semantics.Quantities.Decimal" Version="x.y.z" />

Usage Example

using ktsu.Semantics.Quantities;   // types resolve to their decimal form via the injected aliases

Mass mass = Mass.FromKilogram(10.0m);
Speed speed = Speed.FromMeterPerSecond(15.0m);
Mass total = mass + Mass.FromKilogram(2.0m);   // still a Mass<decimal>, full identity

Force3D f = new() { X = 3.0m, Y = 4.0m, Z = 0.0m };
ForceMagnitude mag = f.Magnitude();            // 5.0

Under the hood the injected alias looks like this (one line per quantity, roughly 220 in total):

<Using Include="ktsu.Semantics.Quantities.Mass&lt;decimal&gt;" Alias="Mass" />

Use exactly one storage-type alias package per project

The aliases are project-wide global usings keyed on the bare type name (Mass, Speed, ...). Referencing two flavor packages in the same project would define the same alias name twice (one bound to decimal, one to another type), which is a compile error. So reference exactly one of:

A project that genuinely needs mixed storage types should skip the alias packages and reference ktsu.Semantics.Quantities directly, writing the closed generic (Mass<decimal>) explicitly.

The binding applies to the project that declares the PackageReference, and to no other. The props ship in the package's build/ folder rather than buildTransitive/, so they are not inherited by projects that reference this project. An application assembled from several projects, each wrapping a different storage type, therefore compiles: each project that wants aliases references its own alias package, and no project collects a binding it never asked for. Earlier versions shipped the props in buildTransitive/, where the binding did flow downstream and two of them in one dependency graph produced a wall of CS1537 against a generated file the author never wrote; PrivateAssets="all" on the alias reference was the workaround for that, and is no longer needed.

The alias lists are generated from the quantity catalogue by scripts/Generate-AliasProps.ps1 and validated in CI, so they stay in lockstep with the quantities the core package emits.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.12.0 44 10/11/2026
5.11.6 57 10/10/2026
5.11.5 61 10/9/2026
5.11.4 55 10/9/2026
5.11.3 123 10/8/2026
5.11.2 304 10/6/2026
5.11.1 81 10/6/2026
5.11.1-pre.1 60 10/5/2026
5.11.0 127 10/2/2026
5.10.0 120 9/30/2026
5.9.0 104 9/29/2026
5.8.5 104 9/29/2026
5.8.4 95 9/29/2026
5.8.3 128 9/28/2026
5.8.2 121 9/28/2026
5.8.1 128 9/28/2026
5.8.0 118 9/25/2026
5.7.0 115 9/24/2026
5.6.0 120 9/23/2026
5.5.1 642 9/22/2026
Loading failed

## v5.12.0 (minor)

Changes since v5.11.0:

- [minor] Simulate color vision deficiencies at any severity in Semantics.Color ([@Claude](https://github.com/Claude))
- Build expected paths with Path.Join in RelativePathMakeTests ([@Claude](https://github.com/Claude))
- [patch] Compute RelativePath.Make by comparing paths, not URIs ([@Claude](https://github.com/Claude))
- [patch] Keep NormalizedParameter.Normalize in [0, 1] for out-of-domain values and reject empty ranges ([@Claude](https://github.com/Claude))
- [patch] Accept only one declared SectionType name in a section header ([@Claude](https://github.com/Claude))
- [patch] Reject JWT segments outside the unpadded base64url alphabet ([@Claude](https://github.com/Claude))
- [patch] Stop [PrefixAndSuffix] letting the prefix and suffix overlap, and reject empty strings ([@Claude](https://github.com/Claude))
- [patch] Require the 978/979 Bookland prefix on an ISBN-13 ([@Claude](https://github.com/Claude))
- [patch] Spell the raised seventh above a flat seventh as #7, not a lowered tonic ([@Claude](https://github.com/Claude))
- Filter IBAN whitespace with Where instead of an if inside the loop ([@Claude](https://github.com/Claude))
- [patch] Anchor IBAN, UUID and ULID patterns at the true end, and strip all whitespace from an IBAN ([@Claude](https://github.com/Claude))
- [patch] Strip every trailing separator when canonicalizing a path ([@Claude](https://github.com/Claude))
- [patch] Title-case [IsTitleCase] values with invariant rules, not the thread culture ([@Claude](https://github.com/Claude))
- [patch] Stop Pitch octaves wrapping into range, and reject whitespace or '+' in the octave ([@Claude](https://github.com/Claude))
- [patch] Keep Tempo.TryParse from throwing, and reject infinite tempos and non-positive beats ([@Claude](https://github.com/Claude))
- [patch] Reject whitespace in [IsBase64] regardless of total length ([@Claude](https://github.com/Claude))
- [patch] Reject non-hex characters in Color.FromHex with ArgumentException ([@Claude](https://github.com/Claude))
- [patch] Name the aeolian mode once ([@Claude](https://github.com/Claude))
- [patch] Parse "minor" and "natural_minor" as the Aeolian mode ([@Claude](https://github.com/Claude))
- [patch] Spell fully and half-diminished sevenths as vii°7 and viiø7 ([@Claude](https://github.com/Claude))
- Count CRLF once without advancing the loop counter in CountLines ([@Claude](https://github.com/Claude))
- [patch] Count every line break in HasMinimumLines, HasMaximumLines and HasExactLines ([@Claude](https://github.com/Claude))
- Merge main into dependabot/nuget/MSTest.Sdk-4.4.1 ([@Claude](https://github.com/Claude))
- Use a collection expression for the refused subjects in UnkeepableRelationshipTests ([@Claude](https://github.com/Claude))
- Assert the Go fix from ktsu.Coder and sync the SDK's .gitignore ([@Claude](https://github.com/Claude))
- [patch] Skip empty split entries in a loop, and honour TrimEntries and combined options ([@Claude](https://github.com/Claude))
- [patch] Scale Milliliter from the litre, not from cubic metres ([@Claude](https://github.com/Claude))
- [patch] Search only the file name for FileExtension and FullFileExtension ([@Claude](https://github.com/Claude))
- [patch] Keep ".." segments that climb above the start in RelativeDirectoryPath.Normalize ([@Claude](https://github.com/Claude))