Home › Forums › Mayfly Data Logger › Printing floats with MS_DBG() › Reply To: Printing floats with MS_DBG()
2021-02-08 at 4:39 PM
#15119
The Arduino print function defaults to two decimal places for a float. Normally, if you were using Serial.print(float)
you could control the decimal places with Serial.print(float, decimalPlaces)
. But because of the way the MS_DBG macro is written, that won’t work. You’ll have to create a String from the number and then MS_DBG that: MS_DBG(String(float, decimalPlaces));