Home

[Package Index | Mudlib Index | Effect Index]

File /secure/simul_efun/query_number.c

Cotains some simul_efuns to convert integers into textual numbers.

Written by Pinkfish

Method index

  • number_as_string(int)
    This method turns a number less than 100 into a string.
  • query_num(int, int)
    This method turns a number into a string.
  • query_times(int)
    Convert a number into a number of times.
  • word_ordinal(int)
    This method returns the ordinal of a number as a string (ie, "first", "thirtieth", etc.

Public Functions

These are functions that everyone can access.

.

    number_as_string
    string number_as_string(int n)
    

    This method turns a number less than 100 into a string. This function should not be used. It will only work for numbers less than 100.
    • Parameters:
      n - the number to turn into a string
    • Returns:
      the number as a nice string
    • See also:
      query_num()
    query_num
    string query_num(int n,
                     int limit)
    

    This method turns a number into a string. It returns a string of the form "one hundred and twenty four". This function should be used and not number_as_string below. The limit argument is used to set the cut off point at which it will print "many".
    • Parameters:
      i - the number to return as a string
      limit - the largest number to process
    • Returns:
      the number as a nice string
        query_times
        string query_times(int num)
        

        Convert a number into a number of times. eg. 1 = once, 2 = twice, 3 = three times etc. etc.
        • Parameters:
          the - number in question
        • Returns:
          a string equivalent.
            word_ordinal
            string word_ordinal(int num)
            

            This method returns the ordinal of a number as a string (ie, "first", "thirtieth", etc.)
Valid HTML 4.01 Transitional
Valid CSS!
Read More