[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /secure/simul_efun/amtime.c</h2>
Cotains some simul_efuns.<p>Written by Pinkfish
<h2>Includes</h2>
This class includes the following files <a href="include.am_time.h.shtml">/include/am_time.h</a><h2>Method index</h2>
<dl><ul>
<li><a href="#amtime">amtime</a>(int, int)<br/>
This method returns the amtime for the input time number.
<li><a href="#ordinal">ordinal</a>(int)<br/>
Adds a "rd", "th", "st" onto a number.
<li><a href="#query_time_string">query_time_string</a>(int, int, int, int)<br/>
 This function will take an integer and turn it into a pretty string
 based on the various and sundry options you pass to it.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="amtime">
amtime</a><pre>
varargs string amtime(int number,
                      int format)
</pre></br>
This method returns the amtime for the input time number.  This function takes
the same input as the efun ctime().  You pass in the time number and
it returns a string detailing the time in ankh morpork.

<br/><ul>
<li><b>Parameters:</b>
<br/>number - the time number
<li><b>Returns:</b>
<br/>a string containing the amtime

</dl>

<ul><a name="ordinal">
ordinal</a><pre>
string ordinal(int number)
</pre></br>
Adds a "rd", "th", "st" onto a number.  Takes a number as an input and
adds the ordinal type on it.  So you get 3rd and 2nd etc as return
strings.

<br/><ul>
<li><b>Parameters:</b>
<br/>number - the number to add the ordinal too
<li><b>Returns:</b>
<br/>a string being the number plus the ordinal

</dl>

<ul><a name="query_time_string">
query_time_string</a><pre>
varargs string query_time_string(int t,
                                 int max_elements,
                                 int am_time,
                                 int use_words)
</pre></br>
 This function will take an integer and turn it into a pretty string
 based on the various and sundry options you pass to it.  You pass the
 variable t to the function, which represents the number of seconds
 you want to turn into a string.  max_elements is the first option, and
 it specifies how many elements you would like to return.  It will
 default to two, and -1 will mean "any number of elements".<p>

 am_time is a boolean value which tells the function how to interpret
 the 't' variable.  If you pass true (1) then it will interpret the
 seconds as game seconds, if you pass false (0), then it will interpret
 them as real-life seconds.<p>

 Finally, use_words will determine whether or not the function will use
 numbers (e.g., 2 years and 24 hours) or words (e.g., two years and
 twenty-four hours).<p>

 @param t how many seconds to turn into a string
 @param max_elements the maximum number of time elements to return
 @param am_time whether to interpret t as game time or real time
 @param use_words whether to return numbers or words

 @example query_time_string (86410) will return "1 day and 10 seconds"
 @example query_time_string (86461) will return "1 day and 1 minute"
 @example query_time_string (86461, -1) will return "1 day, 1 minute,
  and 1 second"
 @example query_time_string (86461, -1, 0, 1) will return "one day,
  one minute, and one second"

 @author Sousjagne




[an error occurred while processing this directive]

