Skip to content

Commit

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

/// <summary>
/// Converts a temperature value from Kelvin to Fahrenheit.
/// </summary>
/// <param name="kelvin">Temperature value in Kelvin.</param>
/// <returns>Temperature value in Fahrenheit.</returns>
public static double KelvinToFahrenheit(double kelvin) => kelvin * 9 / 5 - 459.67;
}
}

0 comments on commit a6e5202

Please sign in to comment.