Rounding floats

Why are you wanting to do this? If you are sending it to a dashboard node, for example, most of them allow you to do this at display time by using something like this in the Value Format field
{{msg.payload | number: 2}}
Generally numbers should not be rounded until they get to the display, it is not good to throw away accuracy before it is necessary.

2 Likes