I have been trying to serialize a decimal value with a string key but so far i only managed to make a successful 1 decimal digit (like '16.1'). I tried both json and simplejson libraries, subclassing the encoder, etc....
This works:
jsonContent = json.dumps({"value": Decimal('15.4')})
This doesn't:
jsonContent = json.dumps({"value": Decimal('15.43')})
Next steps in my code is to encode the jsonContent variable even if i think it's not necessary as it returns the same string and send it through serial bus. I can't get why with one decimal digit it works and not with more...I also tried with round() and float which ends with the same result. Thank you by advance.