Skip to content

Commit

Permalink
Added KelvinToCelsius() method (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Dec 3, 2023
1 parent 1bfc3a9 commit ec6dfc8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions PeyrSharp.Core/Converters/Temperatures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,12 @@ public static class Temperatures
/// <param name="fahrenheit">Temperature value in Fahrenheit.</param>
/// <returns>Temperature value in Kelvin.</returns>
public static double FahrenheitToKelvin(double fahrenheit) => (fahrenheit + 459.67) * 5 / 9;

/// <summary>
/// Converts a temperature value from Kelvin to Celsius.
/// </summary>
/// <param name="kelvin">Temperature value in Kelvin.</param>
/// <returns>Temperature value in Celsius.</returns>
public static double KelvinToCelsius(double kelvin) => kelvin - 273.15;
}
}

0 comments on commit ec6dfc8

Please sign in to comment.