worldbank / iefieldkit

Stata commands designed for Impact Evaluations field work. These are tools that are used during/after a survey in the field for data quality monitoring.
MIT License
39 stars 18 forks source link

iecorrect: fix issue with precision #209

Closed luizaandrade closed 2 years ago

luizaandrade commented 2 years ago

The solution for #187 in #203 isn't quite right -- it needs to check the underlying data type of numeric variables and act appropriately, using the float() function for floats and using the double() function for doubles I believe. I'm not sure what to do in all other cases -- but we certainly would not want to check/pass a float() value against/into an int variable as this might do! We may however want to return an error if a non-integer value is attempted to be used with an integer variable.

luizaandrade commented 2 years ago

This only adds the functions to the if statement. Add if to the actual replacement as well