Skip to content

Instantly share code, notes, and snippets.

@snerpton
snerpton / convertWindNumToText.cs
Last active October 15, 2019 09:50
Method to convert numeric wind direction to text e.g. 25 returns NNE
/// <summary>
/// Converts direction in degrees to a text based description, e.g. 25 returns NNE
/// </summary>
/// <param name="windDirectionDegrees">Direction in degrees</param>
/// <returns>Wind direction as text</returns>
private string GetWindDirection(double windDirectionDegrees)
{
if (windDirectionDegrees > 348.75 && windDirectionDegrees < 11.25)
{