How much precision do you need, and what is the upper limit of the range?
You might be able to get away with specifying a fixed format, padded with leading zeros.
Eg.” %05.1f ml/h”
Would output
009.0 ml/h
010.0 ml/h
Pete
Dirk and all,
I have a device that requires a command of the following format:
ratei NNNNN ml/h
where NNNNN is a number that is exactly 5 characters long including the decimal point. For example if the rate is 9 then:
ratei 9.000 ml/h
If the rate is 10 then the string must be
ratei 10.00 ml/h
If one sends 10.000 (six characters) the command is rejected.
Is there a way to achieve this with streamDevice?
I can’t use the field width flag, since that just sets a minimum field width. I need to set a maximum field width.
I realize this is a ridiculous behavior for a device, but I need to deal with it.
Thanks,
Mark