tosunthex / CoinGecko

CoinGecko .Net Standard api wrapper
111 stars 46 forks source link

The goingecko 'atl_change_percentage' in the full data respone is not always a decimal #38

Closed Glenvds closed 2 years ago

Glenvds commented 2 years ago

Hi,

I'm running on an issue on a particular coin at this moment: hundered-finance. The atl_change_percentage of this coin at the moment of writing is: 1.4209472837214499e+29. This is caused by the 'all-time-low'-value that is 0 for this coin. I assume that this is not normal and a bug at coin gecko.

When I request all coin date about this coin I get this exception:

---> System.Net.Http.HttpRequestException: Input string '1.4209472837214499e+29' is not a valid decimal.
Path 'market_data.atl_change_percentage.aed', line 1, position 7972.
   at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri)
   at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline)

So it looks like this kind of value is possible in the atl_change_percentage response and this can't be converted into a decimal for the public Dictionary<string, decimal> AtlChangePercentage.

brondavies commented 2 years ago

This doesn't appear to be a problem anymore. It could be that CoinGecko changed the implementation to not return scientific notation for very large numbers or that the value is no longer outside of the normal range