Historical age

From Kolmafia
Revision as of 23:07, 5 May 2010 by imported>Bale (created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

float historical_age(item shop_for )

  • shop_for for which to check the price's age

Returns the age of the price that historical_price() will return. The return value is in days, so a returned value of 1.25 means that the price is 1 day and 6 hours old.

Code Samples

Returns a price no more than 18 hours old by checking mall_price() if the historical_price() is older than that.

int check_price(item shopfor) {
   if(historical_age(shopfor) > .75)
      return mall_price(shopfor);
   return historical_price(shopfor);
}

See Also

historical_price() | mall_price()