I have an integer value that is read from a PLC device via bluetooth and the first digit represent one decimal place. For example: 100 must be formatted to 10.0. Another examples:
500 -> 50.0
491 -> 49.1
455 -> 45.5
The following line will make it okay:
data11.put("Text2", String.format("%.1f", (float)(mArray[18] & 0xFF | mArray[19] << 8) / 10.0));
But... Is there another way to do the same using String.format without divide by 10.0?
Thank you