ThunderUnitsDotNet 2.1.1

dotnet add package ThunderUnitsDotNet --version 2.1.1                
NuGet\Install-Package ThunderUnitsDotNet -Version 2.1.1                
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="ThunderUnitsDotNet" Version="2.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ThunderUnitsDotNet --version 2.1.1                
#r "nuget: ThunderUnitsDotNet, 2.1.1"                
#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.
// Install ThunderUnitsDotNet as a Cake Addin
#addin nuget:?package=ThunderUnitsDotNet&version=2.1.1

// Install ThunderUnitsDotNet as a Cake Tool
#tool nuget:?package=ThunderUnitsDotNet&version=2.1.1                

Thunder Unit Conversion Library

Summary

A C# library for handling unit conversions.

Features:

  • Unit definitions are specified in an XML file so they can be modified, added, or removed without compiling the software.
  • Different sets of units can be maintained by using different XML files. For example, a simplied set and a larger, more complete, set.
  • A single conversion for each unit is specified. It is not necessary to specify every combination of unit conversions.

Usage

UnitConverter.Deserialize("units.xml");

// Parsing. UnitResult result = unitConverter.ParseUnitString("1 m", out double value, out string inUnits);

// Conversion. result = unitConverter.ConvertUnits(value, inUnits, "ft", out double convertedValue);

User Interface

A companion package exists which adds user interface components (ThunderUnitsMauiUI). That package adds view models and views for .Net Maui. It can be used directly, or the source code (available at the package repository) can be used and modified as required.

History

Originally created by Robert Harwood (robharwood@runbox.com) and posted as open-sourced on Code Project. The original page has been lost over time. This version has been updated to work with newer .Net language features.

Version 2 changes the format of the XML file to correspond to a change in philosophy. The primary method of editing the XML file through a user interface rather than directly editing it. To support this, and clean up the source code, the format was changed. It is no longer compatible with the original format.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ThunderUnitsDotNet:

Package Downloads
ThunderUnitsMauiUI

Interface components for using the Thunder Units conversion library in .Net Maui.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.1 104 12/31/2024
2.1.0 113 12/5/2024
2.0.0 118 8/27/2024
0.6.1 81 7/28/2024
0.6.0 83 7/28/2024