Historical age: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
created page
 
imported>Bale
mNo edit summary
Line 5: Line 5:
FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Item Management|


function1={{Function|
function1={{Function|
Line 33: Line 32:
see_also={{SeeAlso|historical_price|mall_price}}|
see_also={{SeeAlso|historical_price|mall_price}}|
}}
}}
[[Category:Item Management]]

Revision as of 21:50, 21 May 2010

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()