Treebion.UnitConversion 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Treebion.UnitConversion --version 1.0.0
                    
NuGet\Install-Package Treebion.UnitConversion -Version 1.0.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="Treebion.UnitConversion" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Treebion.UnitConversion" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Treebion.UnitConversion" />
                    
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 Treebion.UnitConversion --version 1.0.0
                    
#r "nuget: Treebion.UnitConversion, 1.0.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.
#addin nuget:?package=Treebion.UnitConversion&version=1.0.0
                    
Install Treebion.UnitConversion as a Cake Addin
#tool nuget:?package=Treebion.UnitConversion&version=1.0.0
                    
Install Treebion.UnitConversion as a Cake Tool

UnitConversion 📏⚡

A .NET library for converting between units of measurement such as length, temperature, volume, speed, and more.

NuGet License


📦 Installation

You can install UnitConversion via NuGet Package Manager or .NET CLI:

Using .NET CLI

dotnet add package UnitConversion

Using NuGet Package Manager

Install-Package UnitConversion

📖 Usage

Here's how you can use UnitConversion to convert between different units:

1️⃣ Temperature Conversion

Convert Celsius to Fahrenheit:

using UnitConversion;

double celsius = 0;
var fahrenheit = new Temperature(celsius, TemperatureUnit.Celsius).To(TemperatureUnit.Fahrenheit);
Console.WriteLine($"{celsius} °C = {fahrenheit.Value} °F");

2️⃣ Length Conversion

Convert meters to miles:

using UnitConversion;

double meters = 1000;
var miles = new Length(meters, LengthUnit.Meter).To(LengthUnit.Mile);
Console.WriteLine($"{meters} meters = {miles.Value} miles");

3️⃣ Speed Conversion

Convert kilometers per hour to miles per hour:

using UnitConversion;

double kmph = 100;
var mph = new Speed(kmph, SpeedUnit.KilometersPerHour).To(SpeedUnit.MilesPerHour);
Console.WriteLine($"{kmph} km/h = {mph.Value} mph");

📌 Supported Units

Length: Meter, Kilometer, Mile, Yard, Foot, Inch

Temperature: Celsius, Fahrenheit, Kelvin

Speed: Kilometers per Hour, Miles per Hour, Meters per Second

Volume: Liter, Milliliter, Gallon, Cubic Meter

And more!


💡 Contributing

Contributions are welcome! If you’d like to improve the library, follow these steps:

  1. Fork the repository.
  2. Clone your forked repo:
    git clone https://github.com/Treebion/UnitConversion.git
    
  3. Create a new branch:
    git checkout -b feature-new-conversion
    
  4. Commit your changes and push the branch.
  5. Submit a Pull Request (PR) for review.

📜 License

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


📬 Contact

📌 GitHub Repository: UnitConversion

📧 For any inquiries, feel free to reach out!


🚀 Happy Coding! 🎉

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.
  • net8.0

    • No dependencies.

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
1.0.1 101 2/1/2025
1.0.0 87 1/29/2025