Need some help with "const float"

Hi, in the Sketch below, the wind direction is shown in letters but I'd like to also have the actual compass heading from the array of Floats.

I tried things like this

  Serial.print(winddirections[dataBytes[4] & 0x0F]);
// or
  int winddir = dataBytes[4] & 0x0F;
  Serial.print(winddirections[winddir]);
// or
  int winddir = dataBytes[4] & 0x0F;
  Serial.print(winddirections[winddir],2);

But, I keep getting weird numbers like "S = 180.00175" even though I thought I had defined it to 2-places.

Where am I going wrong?

Oooops, Sketch was rejected as too big to include as text, so have attached it.

WeatherStation.ino (22 KB)

  int winddir = dataBytes[4] & 0x0F;

Have you tried printing the value of winddir ?
What range of values do you get ?

const float winddirections[] = { 315.0, 247.5, 292.5, 270.0, 
                                 337.5, 225.0, 0.0, 202.5,
                                 67.5, 135.0, 90.0, 112.5,
                                 45.0, 157.5, 22.5, 180.0 };

The following will print 1 decimal place:

Serial.print(winddirections[winddir],1);

Thanks guys, a Arduino 1.8.5 or Ubuntu 16.04 glitch it seems. After trying everything, I was still getting values for winndir of 9153, 1177, 1306.

Shut everything down and started up again and now I am getting the 2-decimal places I originally thought I should get.