Commodity Calculator

[insert_php]
$comms[‘China’] = 4;
$comms[‘Coffee’] = 50;
$comms[‘Diamonds’] = 2;
$comms[‘Frankincense’] = 2;
$comms[‘Gold’] = 1;
$comms[‘Ivory’] = 10;
$comms[‘Jade’] = 2;
$comms[‘Olives’] = 10;
$comms[‘Opium’] = 1;
$comms[‘Pearls’] = 2;
$comms[‘Silk’] = 10;
$comms[‘Spice’] = 5;
$comms[‘Tea’] = 50;
$fair_time = ‘4/808’;
$goldPrice = 242;
$cost[‘Hireling’] = 198;
$cost[‘Slave’] = 726;
[/insert_php]

Only use this tool to get a rough idea of somebody’s commoditiy value based on current/latest fair price, which at the time of writing is [insert_php]echo $fair_time;[/insert_php]

The calculations are worked out as follows: “Low Value” is [1 Gold ÷ NumCommodity], in which NumCommodity is the number of Commodities to exchange.
Primary and Secondary are worked out at the cost of buying 10 Hirelings or 6 Slaves (Respectively) then dividing it by NumCommodity.

[insert_php]
foreach( $comms as $name => $number ):
$lowPrice = ceil( $goldPrice / $number );
$primaryPrice = ceil( ( $cost[‘Hireling’] * 10) / $number);
$secondaryPrice = ceil( ( $cost[‘Slave’] * 6) / $number);

printf( “

\n\t\t

\n\t\t

\n\t\t

\n\t\t

\n\t

\n\t”, $name, number_format($lowPrice), number_format($primaryPrice), number_format($secondaryPrice));
endforeach;
[/insert_php]

CommodityLow ValuePrimary ValueSecondary Value
%s%s%s%s