%d
is an integer format-specifier so it’s rounding whatever value it gets to the nearest integer. Your parameter is a float, so you want to use %f
instead (or you can use e.g. %.3f
if you want a float with three decimal places).
Even better, if you’re using Python 3 you can use f-strings, and if you’re using >= Python 3.8 you can use the equals formatting that can help make things a bit clearer:
message = master.recv_match(type='PARAM_VALUE', blocking=True).to_dict()
name, value = message['param_id'], message['param_value']
print(f'{name = }\t{value = :.3f}')
By the way, where possible it’s preferred for code to be posted as code blocks, so it can be directly copied for testing. There are instructions for how to do that in the Formatting a Post/Comment section of the “How to Use the Blue Robotics Forums” pinned post
EDIT: More generally, those two examples could do with an update, so I’ve raised a github issue about that here: