While playing around with a ESP8266 DevBoard and Arduino IDE 1.6.4 found that it's returning wrong values for any float with more than 1 "0" after "." aka small values like 0.0256.
Try and check the result with the simple code below for 0.256, 0.0256, 0.00256.
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
char charVal[10]; //temporarily holds data from vals
String stringVal = ""; //data on buff is copied to this string
float fVal = 0.0256;
Serial.print("Value :");
Serial.println((float)fVal);
dtostrf(fVal, 8, 4, charVal); //4 is mininum width, 3 is precision; float value is copied onto buff
stringVal = charVal;
int strl = stringVal.length()-1;
Serial.print("Conv val :"); Serial.println(charVal);
Serial.print("Length: ");Serial.println(strl); //display string
Serial.print("Conv val :"); Serial.println(stringVal);
Serial.println("\n");
delay(3000); // delay in between reads for stability
}
For reference: MAX7219 8 Bit Display module driver - ESP8266.