Skip to content

Commit

Permalink
Added FahrenheitToKelvin() method (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Dec 3, 2023
1 parent c41cc2a commit 1bfc3a9
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 @@ -49,5 +49,12 @@ public static class Temperatures
/// <param name="celsius">Temperature value in Celsius.</param>
/// <returns>Temperature value in Kelvin.</returns>
public static double CelsiusToKelvin(double celsius) => celsius + 273.15;

/// <summary>
/// Converts a temperature value from Fahrenheit to Kelvin.
/// </summary>
/// <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;
}
}

0 comments on commit 1bfc3a9

Please sign in to comment.