issues icon indicating copy to clipboard operation
issues copied to clipboard

Decimals in some volumes

Open e0ff opened this issue 4 years ago • 2 comments

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.

e0ff avatar Feb 08 '22 02:02 e0ff

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.

matichenor avatar Feb 08 '22 20:02 matichenor

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.

e0ff avatar Feb 09 '22 00:02 e0ff