Hi all,
we all know the PREC field of many records. Unforunately, its purpose
is not documented very precisely. The Application Developer's Guide
says in chapter 3.5.1 (EPICS Overview - Channel Access - Client
Services):
"In addition to requesting process variable values, any combination of
the following additional information may be requested:
[...]
* Precision: Precision with which to display floating point numbers."
In the Record Reference Manual, one can read e.g. in the ai chapter:
"The PREC field determines the floating point precision with which to
display VAL."
But what does this exactly mean? I think, the most intuitive sense is
to format the value like "%.<PREC>f". At least this is the default
behaviour of medm when using a text monitor. But why not like
"%.<PREC>g" or "%.<PREC>e"? And why does neither caget nor camonitor
honor PREC? And what about negative PREC values?
I suggest the following:
PREC >= 0 means to format the value like printf("%.*f",PREC,VAL);
PREC < 0 means to format the value like printf("%.*e",-PREC,VAL);
All tools including caget and camonitor should honor PREC.
Any comments?
Dirk