polygon-io / issues

Quickly track and report problems with polygon.io
29 stars 0 forks source link

Decimals in some volumes #194

Closed jhert0 closed 1 year ago

jhert0 commented 2 years ago

URL /v2/aggs/ticker/SNDL/range/1/multiplier/2022-02-01/2022-02-01

Result

Volume on this result only includes a decimal, all the other ones are integers.

        {
            "n": 272,
            "t": 1643726040000,
            "l": 0.4812,
            "h": 0.4898,
            "c": 0.4862,
            "o": 0.484,
            "vw": 0.484,
            "v": 1748755.0
        },

I checked AAPL on the same day and there are also some in there too.

matichenor commented 2 years ago

All of these number formats are actually valid according to the JSON spec.

That said, can you elaborate on what problem the different number formats is causing you? What language or mechanism are you using to interface with the polygon.io APIs?

If we understand your challenge better we might be able to address this in a client library.

jhert0 commented 2 years ago

Yeah, I know its valid. I just wasn't expecting floats in the volume.

I guess it's not really a problem, its just that it's inconsistent.

I'm using go and I originally had uint64 in my struct but had to change it to float64 since sometimes it returns all integers and sometimes floats are mixed in.