Use this instead in Gateway to set decimals:
dtostrf(floatvar, StringLengthIncDecimalPoint, numVarsAfterDecimal, charbuf);
Where
floatvar float variable
StringLengthIncDecimalPoint This is the length of the string that will be created
numVarsAfterDecimal The number of digits after the deimal point to print
charbuf the array to store the results
Use this instead in Gateway to set decimals: dtostrf(floatvar, StringLengthIncDecimalPoint, numVarsAfterDecimal, charbuf);
Where floatvar float variable StringLengthIncDecimalPoint This is the length of the string that will be created numVarsAfterDecimal The number of digits after the deimal point to print charbuf the array to store the results
static float f_val = 123.6794; static char outstr[15]; dtostrf(f_val,7, 3, outstr); Serial.begin(9600); Serial.println(outstr);
ref: https://www.hobbytronics.co.uk/arduino-float-vars