Open dbedrenko opened 9 years ago
In ecpiww.c in Log2File() on line:
ecpiww.c
Log2File()
sprintf(param, "./add2vz.sh %d %ld ", meterindex+1, (long int)metervalue*1000);
It typecasts metervalue before the scaling is done. A value of 140.1 is typecast to long int 140, and only then scaled to become 140000. but it should be 140100.
metervalue
long int
Fix this by scaling first then typecasting:
sprintf(param, "./add2vz.sh %d %ld ", meterindex+1, (long int)(metervalue*1000));
In
ecpiww.c
inLog2File()
on line:It typecasts
metervalue
before the scaling is done. A value of 140.1 is typecast tolong int
140, and only then scaled to become 140000. but it should be 140100.Fix this by scaling first then typecasting: