Hello,
I am doing some real to string conversion to send out on a serial string using the REAL_TO_STRING command.
My problem is that when the REAL is 50.1 the string is then rounded down very slightly to '50.0999984741211'
It is only when the real has a value after the decimal point.
50 is represented as 50.0 in the string.
1) Why is this doing this?
2) How can I stop it? There is a TRUNC instruction to truncate but then I loose everything after the decimal point.
I can't see a round function neither.
Thanks for any help
Matt
I am doing some real to string conversion to send out on a serial string using the REAL_TO_STRING command.
My problem is that when the REAL is 50.1 the string is then rounded down very slightly to '50.0999984741211'
It is only when the real has a value after the decimal point.
50 is represented as 50.0 in the string.
1) Why is this doing this?
2) How can I stop it? There is a TRUNC instruction to truncate but then I loose everything after the decimal point.
I can't see a round function neither.
Thanks for any help
Matt
Last edited: