def numerals(n, round=2):
    if isinstance(n, basestring):
        if n.isdigit():
            n = int(n)
        else:
            # If the float is given as a string, extract the length of the fractional part.
            if round is None:
                round = len(n.split(".")[1])
            n = float(n)
    # For negative numbers, simply prepend minus.
    if n < 0:
        return "%s %s" % (MINUS, numerals(abs(n)))
    # Split the number into integral and fractional part.
    # Converting the integral part to a long ensures a better accuracy during the recursion.
    i = long(n//1)
    f = n-i
    # The remainder, which we will stringify in recursion.
    r = 0
    if i in NUMERALS_INVERSE: # 11 => eleven
        # Map numbers from the dictionary to numerals: 11 => "eleven".
        s = NUMERALS_INVERSE[i]
    elif i < 100:
        # Map tens + digits: 75 => 70+5 => "seventy-five".
        s = numerals((i//10)*10) + "-" + numerals(i%10)
    elif i < 1000:
        # Map hundreds: 500 => 5*100 => "five hundred".
        # Store the remainders (tens + digits).
        s = numerals(i//100) + " " + ORDER[0]
        r = i % 100
    else:
        # Map thousands by extracting the order (thousand/million/billion/...).
        # Store and recurse the remainder.
        s = ""
        o, base = 1, 1000
        while i > base:
            o+=1; base*=1000
        while o > len(ORDER)-1:
            s += " "+ORDER[-1] # This occurs for consecutive thousands: million vigintillion.
            o -= len(ORDER)-1
        s = "%s %s%s" % (numerals(i//(base/1000)), (o>1 and ORDER[o-1] or ""), s)
        r = i % (base/1000)
    if f != 0: 
        # Map the fractional part: "two point twenty-five" => 2.25.
        # We cast it to a string first to find all the leading zeros.
        # This actually seems more accurate than calculating the leading zeros,
        # see also: http://python.org/doc/2.5.1/tut/node16.html.
        # Some rounding occurs.
        f = ("%." + str(round is None and 2 or round) + "f") % f
        f = f.replace("0.","",1).rstrip("0")
        f, z = zshift(f)
        f = f and " %s%s %s" % (RADIX, " %s"%ZERO*z, numerals(long(f))) or ""
    else:
        f = ""
    if r == 0:
        return s+f
    elif r >= 1000: 
        # Separate hundreds and thousands with a comma: two million, three hundred thousand.
        return "%s%s %s" % (s, THOUSANDS, numerals(r)+f)
    elif r <= 100:  
        # Separate hundreds and tens with "and": two thousand three hundred and five.
        return "%s %s %s" % (s, CONJUNCTION, numerals(r)+f)
    else:
        return "%s %s" % (s, numerals(r)+f)

#--- APPROXIMATE -----------------------------------------------------------------------------------
# Based on the Ruby Linguistics module by Michael Granger:
# http://www.deveiate.org/projects/Linguistics/wiki/English
Returns the given int or float as a string of numerals.
dataset/ETHPy150Open clips/pattern/pattern/text/en/inflect_quantify.py/numerals