veekun/pokedex

Why are Pokemon weight and height from the API 10x their actual value?

Closed this issue · 4 comments

So when I was using PokeAPI, I found that running a GET request on a Pokemon yields heights and weights for Pokemon that are 10x their original value. In order to find out the reasoning behind this, I opened an issue on PokeAPI. The response there was that "[w]e take our data from Veekun [and] [w]e do not modify" it.

So I will ask the same question here: Why are Pokemon weight and height from the API 10x their actual value?

It's an issue of units: The games store height in decimeters and weight in decagrams (good units to use if you need to store the info as whole numbers, but extremely weird for any other use, like displaying the data to people).

See: https://github.com/veekun/pokedex/blob/master/pokedex/db/tables.py#L1649

So just to clarify, are these values are going to be kept as is?

I don't have much say here any more, but I think I can answer this :)

Yes, they will be kept as whole numbers, as the games store them.
Integers are a better fit than floats (which are inexact) or decimals (which are not as readily available in most programming languages).

Cool, thanks for the clarification!