Creates a string representation of a fraction with all digits

Ex: new Fraction("100.'91823'").toString() => "100.(91823)"
323792
function(dec) {

      let g;
      let N = this["n"];
      let D = this["d"];

      dec = dec || 15; // 15 = decimal places when no repitation

      let cycLen = cycleLen(N, D); // Cycle length
      let cycOff = cycleStart(N, D, cycLen); // Cycle start

      let str = this['s'] < C_ZERO ? "-" : "";

      // Append integer part
      str += N / D | C_ZERO;

      N %= D;
      N *= C_TEN;

      if (N)
        str += ".";

      if (cycLen) {

        for (let i = cycOff; i--; ) {
          str += N / D | C_ZERO;
          N %= D;
          N *= C_TEN;
        }
        str += "(";
        for (let i = cycLen; i--; ) {
          str += N / D | C_ZERO;
          N %= D;
          N *= C_TEN;
        }
        str += ")";
      } else {
        for (let i = dec; N && i--; ) {
          str += N / D | C_ZERO;
          N %= D;
          N *= C_TEN;
        }
      }
      return str;
    }
954805
def random_string(length, numeric_only=False):
    
    choices = string.digits if numeric_only else string.ascii_uppercase + string.digits
    return ''.join(random.choice(choices) for _ in range(length))
522356
def round_to_x_digits(number, digits):
    
    return round(number * math.pow(10, digits)) / math.pow(10, digits)
1315758
def stringify(self):
        
        hexcode = "#"
        for x in self.value:
            part = hex(x)[2:]
            if len(part) < 2: part = "0" + part
            hexcode += part
        return hexcode
861139
function numberToString (x) { // avoids scientific notation for too large and too small numbers

    if (isString (x)) return x

    if (Math.abs (x) < 1.0) {
        const s = x.toString ()
        const e = parseInt (s.split ('e-')[1])
        const neg = (s[0] === '-')
        if (e) {
            x *= Math.pow (10, e-1)
            x = (neg ? '-' : '') + '0.' + (new Array (e)).join ('0') + x.toString ().substring (neg ? 3 : 2)
        }
    } else {
        let e = parseInt (x.toString ().split ('+')[1])
        if (e > 20) {
            e -= 20
            x /= Math.pow (10, e)
            x += (new Array (e+1)).join ('0')
        }
    }
    return x.toString ()
}
580849
def str2int(string_with_int):
    
    return int("".join([char for char in string_with_int if char in string.digits]) or 0)
515469
function(separator, digits) {
			separator = separator || ".";
			var s,
				res = [];
			$.each(this.getParentList(false, true), function(i, o) {
				s = "" + (o.getIndex() + 1);
				if (digits) {
					// prepend leading zeroes
					s = ("0000000" + s).substr(-digits);
				}
				res.push(s);
			});
			return res.join(separator);
		}
147541
public String solutionToString(int fractionDigits) {
    if(!isSolvable()) {
      throw new IllegalStateException("System is not solvable!");
    }

    DecimalFormat nf = new DecimalFormat();
    nf.setMinimumFractionDigits(fractionDigits);
    nf.setMaximumFractionDigits(fractionDigits);
    nf.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US));
    nf.setNegativePrefix("");
    nf.setPositivePrefix("");

    int row = coeff[0].length >> 1;
    int params = u.length;
    int paramsDigits = integerDigits(params);

    int x0Digits = maxIntegerDigits(x_0);
    int[] uDigits = maxIntegerDigits(u);
    StringBuilder buffer = new StringBuilder();
    for(int i = 0; i < x_0.length; i++) {
      double value = x_0[i];
      format(nf, buffer, value, x0Digits);
      for(int j = 0; j < u[0].length; j++) {
        if(i == row) {
          buffer.append("  +  a_").append(j).append(" * ");
        }
        else {
          buffer.append("          ");
          for(int d = 0; d < paramsDigits; d++) {
            buffer.append(' ');
          }
        }
        format(nf, buffer, u[i][j], uDigits[j]);
      }
      buffer.append('\n');
    }
    return buffer.toString();
  }
1119281
public static final Function<Integer,String> toCurrencyStr() {
        return (Function<Integer,String>)((Function)FnNumber.toCurrencyStr());
    }
1343538
function toFixedNumber (str, digits) {
  if (digits) {
    return stringToNumber(('' + stringToNumber(str)).replace(new RegExp('(\\d+.\\d{0,' + digits + '}).*'), '$1'))
  }
  return stringToInteger(str)
}
1245156
def decimal_from_string(value)
      Float(value)
      BigDecimal(value, digits)
    rescue ArgumentError
      raise InvalidValueError, "Given value: #{value.inspect}"
    end
350275
function format(number, decimals, thousandsSep, decPoint) {
    number = (number + '').replace(/[^0-9+-Ee.]/g, '')

    var n = !isFinite(+number) ? 0 : +number,
        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
        sep = typeof thousandsSep !== 'string' ? ',' : thousandsSep,
        dec = typeof decPoint !== 'string' ? '.' : decPoint,
        s = ''

    s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.')
    var re = /(-?\d+)(\d{3})/
    while (re.test(s[0])) {
        s[0] = s[0].replace(re, "$1" + sep + "$2")
    }

    if ((s[1] || '').length < prec) {
        s[1] = s[1] || ''
        s[1] += new Array(prec - s[1].length + 1).join('0')
    }
    return s.join(dec)
}
55084
function (valueString) {
			// TODO: Detect other number formats (e.g. comma as decimal separator)
			var valueComp = valueString.split('.');
			var integralPart = valueComp[0];
			var fractionalPart = valueComp[1] || "0";
			while (fractionalPart.length < 8) fractionalPart += "0";
			fractionalPart = fractionalPart.replace(/^0+/g, '');
			var value = BigInteger.valueOf(parseInt(integralPart));
			value = value.multiply(BigInteger.valueOf(100000000));
			value = value.add(BigInteger.valueOf(parseInt(fractionalPart)));
			return value;
		}
808035
def digits
      digitstring = ''
      [:area_code, :prefix, :number].each {|part|
        digitstring += self.send(part).to_s unless self.send(part).nil?
      }
      digitstring += " x#{extension}" unless extension.nil?
      digitstring
    end
403656
public String getExponentPart(final int digit) {
        
        final int length = exponentPart.length();
        if(length < digit || digit <= 0) {
            return "";
        }
        
        return String.valueOf(exponentPart.charAt(length - digit));
        
    }
1026534
function parseDecimal(x, str) {
    var e, i, len;

    // Decimal point?
    if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');

    // Exponential form?
    if ((i = str.search(/e/i)) > 0) {

      // Determine exponent.
      if (e < 0) e = i;
      e += +str.slice(i + 1);
      str = str.substring(0, i);
    } else if (e < 0) {

      // Integer.
      e = str.length;
    }

    // Determine leading zeros.
    for (i = 0; str.charCodeAt(i) === 48;) ++i;

    // Determine trailing zeros.
    for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;
    str = str.slice(i, len);

    if (str) {
      len -= i;
      e = e - i - 1;
      x.e = mathfloor(e / LOG_BASE);
      x.d = [];

      // Transform base

      // e is the base 10 exponent.
      // i is where to slice str to get the first word of the digits array.
      i = (e + 1) % LOG_BASE;
      if (e < 0) i += LOG_BASE;

      if (i < len) {
        if (i) x.d.push(+str.slice(0, i));
        for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));
        str = str.slice(i);
        i = LOG_BASE - str.length;
      } else {
        i -= len;
      }

      for (; i--;) str += '0';
      x.d.push(+str);

      if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);
    } else {

      // Zero.
      x.s = 0;
      x.e = 0;
      x.d = [0];
    }

    return x;
  }
272154
public String getIntegerPart(final int digit) {
        
        final int length = integerPart.length();
        if(length < digit || digit <= 0) {
            return "";
        }
        
        String num = String.valueOf(integerPart.charAt(length - digit));
        if(isUseSeparator()) {
            if(digit >= 4 && (digit-1) % 3 == 0) {
                num += ",";
            }
        }
        
        return num;
        
    }