Skip to content

Decimals truncated of Logged Values  #4

Description

@dbedrenko

In ecpiww.c in Log2File() on line:

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.

Fix this by scaling first then typecasting:

sprintf(param, "./add2vz.sh %d %ld ", meterindex+1, (long int)(metervalue*1000));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions