Skip to content

Commit

Permalink
Merge pull request #496 from the-hideout/avg-low-price-null
Browse files Browse the repository at this point in the history
null instead of 0 for avg, low prices when missing
  • Loading branch information
Razzmatazzz authored May 13, 2024
2 parents f5f38ef + e897b63 commit 01d1b46
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tarkov-data-manager/modules/remote-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const methods = {
...result,
types: result.types?.split(',') || [],
updated: result.last_update,
lastLowPrice: 0,
avg24hPrice: 0,
lastLowPrice: null,
avg24hPrice: null,
};
if (!preparedData.properties) preparedData.properties = {};
returnData.set(result.id, preparedData);
Expand Down Expand Up @@ -214,7 +214,7 @@ const methods = {
}

item24hPrices[itemId]?.sort();
item.avg24hPrice = getInterquartileMean(item24hPrices[itemId] || []);
item.avg24hPrice = getInterquartileMean(item24hPrices[itemId] || []) || null;
item.low24hPrice = item24hPrices[itemId]?.at(0);
item.high24hPrice = item24hPrices[itemId]?.at(item24hPrices[itemId]?.length - 1);

Expand Down

0 comments on commit 01d1b46

Please sign in to comment.