Skip to content

Commit

Permalink
Added CelsiusToKelvin() method (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Dec 3, 2023
1 parent 90dfc5b commit c41cc2a
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 @@ -42,5 +42,12 @@ public static class Temperatures
/// <param name="fahrenheit">Number of Fahrenheit to convert.</param>
/// <returns>The original value converted in Celsius.</returns>
public static double FahrenheitToCelsius(double fahrenheit) => (fahrenheit - 32) / 1.8; // Convert

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

0 comments on commit c41cc2a

Please sign in to comment.