Convert `number` to a Roman numeral.
355805
def romanize(number):
    """"""
    roman = []
    for numeral, value in NUMERALS:
        times, number = divmod(number, value)
        roman.append(times * numeral)
    return ''.join(roman)
1340074
def toint(number):
    
    if isinstance(number, float):
        number = round(number, 0)
    return int(number)
906389
function(num) {
    num = parseInt(num);

    if (num < 10) {
      num = '0' + num;
    } else {
      num = num.toString();
    }

    return num;
  }
1001204
def _convert_to_numeric(item):
    
    if PY3:
        num_types = (int, float)
    else:                                 # pragma: no cover
        num_types = (int, long, float)    # noqa: F821
    # We don't wan't to perform any conversions if item is already a number
    if isinstance(item, num_types):
        return item

    # First try for an int conversion so that strings like "5" are converted
    # to 5 instead of 5.0 . This is safe as a direct int cast for a non integer
    # string raises a ValueError.
    try:
        num = int(to_unicode(item))
    except ValueError:
        try:
            num = float(to_unicode(item))
        except ValueError:
            return item
        else:
            return num
    except TypeError:
        return item
    else:
        return num
854432
def to_number(s):
    
    ret = s
    # try converting to float
    try:
        ret = float(s)
    except ValueError:
        ret = ret.strip('\'').strip()

    # try converting to uid
    try:
        ret = int(s)
    except ValueError:
        pass

    # try converting to boolean
    if ret == 'True':
        ret = True
    elif ret == 'False':
        ret = False
    elif ret == 'None':
        ret = None
    return ret
926827
def number_to_letter(num)
      result = +""

      until num.zero?
        num, index = (num - 1).divmod(26)
        result.prepend(LETTERS[index])
      end

      result
    end
576152
def numeric(basetype, min_=None, max_=None):
    """"""
    min_ = basetype(min_) if min_ is not None else None
    max_ = basetype(max_) if max_ is not None else None

    def _numeric(string):
        value = basetype(string)
        if min_ is not None and value < min_ or max_ is not None and value > max_:
            msg = "%r not in valid range %r" % (string, (min_, max_))
            raise argparse.ArgumentTypeError(msg)
        return value

    _numeric.__name__ = basetype.__name__
    return _numeric
167998
def _number_parser(str_to_number_func):
    """"""
    def _parse_number_value(element_text, state):
        value = None

        try:
            value = str_to_number_func(element_text)
        except (ValueError, TypeError):
            state.raise_error(InvalidPrimitiveValue,
                              'Invalid numeric value "{}"'.format(element_text))

        return value

    return _parse_number_value
825449
def to_eng(num_in):
    """"""
    x = decimal.Decimal(str(num_in))
    eng_not = x.normalize().to_eng_string()
    return(eng_not)
611027
def __to_text(self, number, indice = 0, sing=False):
        """"""

        number = int(number)
        exp = self.exponentes[indice]
        indice += 1
        divisor = 10 ** exp

        if exp == 3:
            func = self.__numero_tres_cifras
        else:
            func = self.__to_text
        
        if divisor < number:
            division = number // divisor
            resto = number % divisor
        
            if resto:
                der = func(resto, indice, sing)
            else:
                der = False

            if exp == 3 and division == 1: #1000
                return "%s %s" % (exponentes_plural[exp], der)
            else:
                izq = func(division, indice, True)
                if der:
                    if division == 1:
                        return "%s %s" % (exponentes_singular[exp], der)
                    else:
                        return "%s %s %s" % (izq, exponentes_plural[exp], der)
                else:
                    if division == 1:
                        return exponentes_singular[exp]
                    else:
                        return "%s %s" % (izq, exponentes_plural[exp])
                        
        elif divisor == int(number):
            if exp == 3:
                return exponentes_plural[exp]
            else:
                return exponentes_singular[exp]
        else:
            return func(number, indice, sing)
1095720
public function romanNumeralsToNumber(string $roman): int
    {
        $num = 0;
        foreach (self::ROMAN_NUMERALS as $key => $value) {
            while (strpos($roman, $value) === 0) {
                $num += $key;
                $roman = substr($roman, strlen($value));
            }
        }

        return $num;
    }
670582
def _format_number_si(num, n_signif_figures):
    """"""
    if math.isnan(num) or math.isinf(num):
        return str(num)
    leading, exp = '{:E}'.format(num).split('E')
    leading = round(float(leading), n_signif_figures - 1)
    exp = exp[:1] + exp[2:] if exp[1] == '0' else exp
    formatted = '{}e{}'.format(leading, exp.lstrip('+'))
    return formatted
447440
def number_to_lower_endian(n, base):
  """"""
  if n < base:
    return [n]
  return [n % base] + number_to_lower_endian(n // base, base)
112530
def apnumber(value):
    """"""
    try:
        value = int(value)
    except (TypeError, ValueError):
        return value
    if not 0 < value < 10:
        return str(value)
    return (_('one'), _('two'), _('three'), _('four'), _('five'), _('six'),
            _('seven'), _('eight'), _('nine'))[value - 1]
1155466
def int_to_roman(num):
    
    conv = (
        ("M", 1000),
        ("CM", 900),
        ("D", 500),
        ("CD", 400),
        ("C", 100),
        ("XC", 90),
        ("L", 50),
        ("XL", 40),
        ("X", 10),
        ("IX", 9),
        ("V", 5),
        ("IV", 4),
        ("I", 1)
    )
    roman = ""
    i = 0
    while num > 0:
        while conv[i][1] > num:
            i += 1
        roman += conv[i][0]
        num -= conv[i][1]
    return roman
1116627
def parse_number(self):
        """"""
        value = self.current_token.value
        suffix = value[-1].lower()

        try:
            if suffix in NUMBER_SUFFIXES:
                return NUMBER_SUFFIXES[suffix](value[:-1])
            return Double(value) if '.' in value else Int(value)
        except (OutOfRange, ValueError):
            return String(value)
423216
function NUM() {
        var _parser = SEQ(OPT('-'), OR('0', SEQ(RANGE('1', '9'), REPEAT(DIGIT()))), OPT(SEQ('.', REPEAT(DIGIT(), 1))), OPT(SEQ(OR('e', 'E'), OPT(OR('+', '-')), REPEAT(DIGIT(), 1))));

        return _make_alias('NUM', paka.P.NUM, _parser);
    }