Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the CSV input always defaults to 2 decimal variable #177

Open
jrking4 opened this issue Feb 28, 2019 · 6 comments
Open

Using the CSV input always defaults to 2 decimal variable #177

jrking4 opened this issue Feb 28, 2019 · 6 comments

Comments

@jrking4
Copy link

jrking4 commented Feb 28, 2019

When trying to use the following:
readstat <input file.csv> <input metadata.json> <output file>

I define my NUMERIC variable with the property "decimals": 0
however ReadStat simply ignores anything I put in that property and just defaults to 2 decimals.

@smartepsh
Copy link

I also have the same problem.

@evanmiller evanmiller added the bug label Aug 27, 2020
@evanmiller
Copy link
Contributor

What is your output format? SAV, DTA, etc

@smartepsh
Copy link

SAV in my case.

@evanmiller
Copy link
Contributor

Any ideas, @ivarref?

@smartepsh
Copy link

A Simple Example

csv data file:

Q,customized
1,1.2345678

meta json:

{
  "type": "SPSS",
  "variables": [
    {
      "decimals": 5,
      "label": "customized",
      "name": "customized",
      "type": "NUMERIC"
    },
    {
      "categories": [
        {
          "code": 1,
          "label": "male"
        },
        {
          "code": 2,
          "label": "female"
        }
      ],
      "decimals": 0,
      "label": "Q",
      "name": "Q",
      "type": "NUMERIC"
    }
  ]

in spss

The decimals value of both variables is 2.

image

@ivarref
Copy link
Contributor

ivarref commented Sep 14, 2020

Hi, I don't have good idea. I'm away from my job until end of October, maybe I can investigate further then.

I do remember doing some extra fixes (3 commits) that never went into WizardMac:master:
https://github.com/ivarref/ReadStat

Particularly using jasmine strict mode to avoid some JSON boundary parsing errors:
ivarref@b3d44c0

Could that be relevant?

Regards.

Edit: JSON boundary parsing errors, not CSV.

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

No branches or pull requests

4 participants