diff --git a/src/rec/calcRecord.c b/src/rec/calcRecord.c index 359c35ef3..722ce0698 100644 --- a/src/rec/calcRecord.c +++ b/src/rec/calcRecord.c @@ -159,12 +159,13 @@ static long get_units(DBADDR *paddr, char *units) static long get_precision(DBADDR *paddr, long *pprecision) { calcRecord *prec = (calcRecord *)paddr->precord; + int fieldIndex = dbGetFieldIndex(paddr); - if (paddr->pfield == (void *)&prec->val) { - *pprecision = prec->prec; - } else { + *pprecision = prec->prec; + + if (fieldIndex != calcRecordVAL) recGblGetPrec(paddr, pprecision); - } + return 0; } diff --git a/src/rec/calcoutRecord.c b/src/rec/calcoutRecord.c index f49c699d8..062580c76 100644 --- a/src/rec/calcoutRecord.c +++ b/src/rec/calcoutRecord.c @@ -374,12 +374,13 @@ static long get_units(DBADDR *paddr, char *units) static long get_precision(DBADDR *paddr, long *pprecision) { calcoutRecord *prec = (calcoutRecord *)paddr->precord; + int fieldIndex = dbGetFieldIndex(paddr); - if (paddr->pfield == (void *)&prec->val) { - *pprecision = prec->prec; - } else { + *pprecision = prec->prec; + + if (fieldIndex != calcoutRecordVAL) recGblGetPrec(paddr, pprecision); - } + return 0; }