Splits a number on thousands.

    >>> split_thousands(1000012)
    "1'000'012"
193594
def split_thousands(s):
    
    # Check input #
    if s is None: return "0"
    # If it's a string #
    if isinstance(s, basestring): s = float(s)
    # If it's a float that should be an int #
    if isinstance(s, float) and s.is_integer(): s = int(s)
    # Use python built-in #
    result = "{:,}".format(s)
    # But we want single quotes #
    result = result.replace(',', "'")
    # Return #
    return result
370153
def numeric_part(s):
    

    m = re_numeric_part.match(s)
    if m:
        return int(m.group(1))
    return None
770847
def split number
      # Split the number into country, cc, and national part.
      country, cc, national_number = partial_split number
      
      # Split the national number into ndc and local part.
      _, ndc, *local = country.split national_number
      
      [cc, ndc, *local]
    end
965811
def split_version(version):
    
    if re.match("^[^0-9].*", version):
        return [version]
    return [int(i) for i in version.split(".")]
1227218
def nice_number_string(number, decimal_places=2):
        """"""
        if number == np.round(number):
            return str(int(number))
        elif number < 1 and number > 0:
            inverse = 1 / number
            if int(inverse) == np.round(inverse):
                return r'\frac{{1}}{{{}}}'.format(int(inverse))
        else:
            template = '{{:.{0}}}'.format(decimal_places)
            return template.format(number)
235972
def split_key(key, max = Float::INFINITY)
      parts = []
      pos   = 0
      return [key] if max == 1
      key_parts(key) do |part|
        parts << part
        pos += part.length + 1
        if parts.length + 1 >= max
          parts << key[pos..-1] unless pos == key.length
          break
        end
      end
      parts
    end
336649
def split_digit(str)
      i = str.index(/.分|.割/)
      if i.nil?
        [str]
      elsif i.zero?
        [nil, str]
      else
        [str[0..i - 1], str[i..-1]]
      end
    end
122597
function split(separator, data, limit) {
	var data = ""+data,
	    results = data.split(separator);
	if(!limit) return results;
	if(results.length <= limit) return results;
	var separators = data.match(new RegExp(separator.source, "g"));
	results[limit-1] = join(results.slice(limit-1), separators.slice(limit-1));
	results.length = limit;
	return results;
}
872310
def parse_large_numbers(str)
      # (?<year>(.*)億)(?<oku>(.*)万)
      splited = Numeja::JA_上数.keys.reverse.map do |ja_digit|
        index = str.index(ja_digit)
        next if index.nil?
        unit = str.slice!(0, index)
        digit = str.slice!(0, 1)
        {
          digit: digit,
          unit: unit
        }
      end
      splited.push(
        digit: '',
        unit: str
      ).compact
    end
1203383
def split_sequence(seq, n):
    """"""
    tokens = []
    while seq:
        tokens.append(seq[:n])
        seq = seq[n:]
    return tokens
952955
def _p100(part, total, prec=1):
    '''
    '''
    r = float(total)
    if r:
        r = part * 100.0 / r
        return '%.*f%%' % (prec, r)
    return 'n/a'
1005159
def _split_str(self, field):
        
        field_items = field.split("|")
        if len(field_items) == 2:
            return field_items[0], field_items[1]
        elif len(field_items) == 1:
            return field_items[0], None
1276876
def tsplit(string, delimiters):
    """"""
    delimiters = tuple(delimiters)
    if len(delimiters) < 1:
        return [string,]
    final_delimiter = delimiters[0]
    for i in delimiters[1:]:
        string = string.replace(i, final_delimiter)
    return string.split(final_delimiter)
1245156
def decimal_from_string(value)
      Float(value)
      BigDecimal(value, digits)
    rescue ArgumentError
      raise InvalidValueError, "Given value: #{value.inspect}"
    end
227729
def format number, options = {}
      country, _, national_number = partial_split number
      country.format national_number, options
    end
830056
function divide(bit) {
  var bitString = ((zeros + zeros) + (Number(bit).toString(2))).slice(-64);

  return [
    parseInt(bitString.slice(0, 32), 2), // hi
    parseInt(bitString.slice(-32), 2) // lo
  ];
}
45199
function unformatNumeral (n, string) {
    var stringOriginal = string,
      thousandRegExp,
      millionRegExp,
      billionRegExp,
      trillionRegExp,
      suffixes = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
      bytesMultiplier = false,
      power;

    if (string.indexOf(':') > -1) {
      n._value = unformatTime(string);
    } else {
      if (string === zeroFormat) {
        n._value = 0;
      } else {
        if (languages[currentLanguage].delimiters.decimal !== '.') {
          string = string.replace(/\./g,'').replace(languages[currentLanguage].delimiters.decimal, '.');
        }

        // see if abbreviations are there so that we can multiply to the correct number
        thousandRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.thousand + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        millionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.million + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        billionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.billion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');
        trillionRegExp = new RegExp('[^a-zA-Z]' + languages[currentLanguage].abbreviations.trillion + '(?:\\)|(\\' + languages[currentLanguage].currency.symbol + ')?(?:\\))?)?$');

        // see if bytes are there so that we can multiply to the correct number
        for (power = 0; power <= suffixes.length; power++) {
          bytesMultiplier = (string.indexOf(suffixes[power]) > -1) ? Math.pow(1024, power + 1) : false;

          if (bytesMultiplier) {
            break;
          }
        }

        // do some math to create our number
        n._value = ((bytesMultiplier) ? bytesMultiplier : 1) * ((stringOriginal.match(thousandRegExp)) ? Math.pow(10, 3) : 1) * ((stringOriginal.match(millionRegExp)) ? Math.pow(10, 6) : 1) * ((stringOriginal.match(billionRegExp)) ? Math.pow(10, 9) : 1) * ((stringOriginal.match(trillionRegExp)) ? Math.pow(10, 12) : 1) * ((string.indexOf('%') > -1) ? 0.01 : 1) * (((string.split('-').length + Math.min(string.split('(').length-1, string.split(')').length-1)) % 2)? 1: -1) * Number(string.replace(/[^0-9\.]+/g, ''));

        // round if we are talking about bytes
        n._value = (bytesMultiplier) ? Math.ceil(n._value) : n._value;
      }
    }
    return n._value;
  }