An open source dynamic link library written in C#, providing methods for temperature conversions.
- Celsius
- Fahrenheit
- Kelvin
- Newton
- Rankine
- Réaumur
- Rømer
To add the library to your project, follow these steps:
- Download the latest release from the Releases page.
- Extract the downloaded ZIP file.
- Copy the
temperature.dll
file to your project's directory, for example in a folder calledLibraries
. - Add the following code to your
.csproj
file, after</PropertyGroup>
:
<ItemGroup>
<Reference Include="Temperature">
<SpecificVersion>false</SpecificVersion>
<HintPath>Libraries\Temperature.dll</HintPath>
</Reference>
</ItemGroup>
To use the library in your code, follow these steps:
- Import the DLL in your code:
using Temperature;
- Call the appropriate method to convert the temperature:
double celsius = 25;
double fahrenheit = Temperature.Celsius.ToFahrenheit(celsius);
or
double fahrenheit = 54;
double kelvin = Temperature.Convert(fahrenheit, "fahrenheit", "kelvin");
or
double kelvin = 77;
Dictionary<string, double> output = Temperature.ConvertAll(kelvin, "kelvin");
Licensed under MIT