Convert val into float with digits decimal.
773417
def __to_float(val, digits):
    """"""
    try:
        return round(float(val), digits)
    except (ValueError, TypeError):
        return float(0)
1082645
def _ConvertFloat(value):
  """"""
  if value == 'nan':
    raise ParseError('Couldn\'t parse float "nan", use "NaN" instead.')
  try:
    # Assume Python compatible syntax.
    return float(value)
  except ValueError:
    # Check alternative spellings.
    if value == _NEG_INFINITY:
      return float('-inf')
    elif value == _INFINITY:
      return float('inf')
    elif value == _NAN:
      return float('nan')
    else:
      raise ParseError('Couldn\'t parse float: {0}.'.format(value))
74337
static
	private Float toFloat(Object value){

		if(value instanceof Float){
			return (Float)value;
		} else

		if(value instanceof Double){
			Number number = (Number)value;

			return toFloat(number.floatValue());
		} else

		if((value instanceof Long) || (value instanceof Integer) || (value instanceof Short) || (value instanceof Byte)){
			Number number = (Number)value;

			return toFloat(number.floatValue());
		} else

		if(value instanceof Boolean){
			Boolean flag = (Boolean)value;

			return (flag.booleanValue() ? Numbers.FLOAT_ONE : Numbers.FLOAT_ZERO);
		} else

		if((value instanceof DaysSinceDate) || (value instanceof SecondsSinceDate) || (value instanceof SecondsSinceMidnight)){
			Number number = (Number)value;

			return toFloat(number.floatValue());
		}

		throw new TypeCheckException(DataType.FLOAT, value);
	}
588313
def binary_float_to_decimal_float(number: Union[float, str]) -> float:
    
    if isinstance(number, str):
        if number[0] == '-':
            n_sign = -1
        else:
            n_sign = 1
    elif isinstance(number, float):
        n_sign = np.sign(number)
        number = str(number)

    deci = 0
    for ndx, val in enumerate(number.split('.')[-1]):
        deci += float(val) / 2**(ndx+1)
    deci *= n_sign

    return deci
882677
def decimal_default(obj):
    """"""
    if isinstance(obj, decimal.Decimal):
        if obj % 1:
            return float(obj)
        return int(obj)
    raise TypeError
1086717
function float(value) {
  var parsedFloat = Number.parseFloat(value);

  // couldn't parse it
  if (typeOf(parsedFloat) != 'number') {
    return throwModifierError('float', value, {message: 'Invalid Float'});
  }

  return parsedFloat;
}
685790
def read_float(self):
        """"""
        self.bitcount = self.bits = 0
        return unpack('>d', self.input.read(8))[0]
1098744
public Item withFloat(String attrName, float val) {
        checkInvalidAttrName(attrName);
        return withNumber(attrName, Float.valueOf(val));
    }
1291001
def to_float(*args):
    
    floats = [np.array(a, dtype=np.float32) for a in args]
    return floats[0] if len(floats) == 1 else floats
1303489
def to_float(unit):
    
    def converter(x):
        """Convert the input to a `float` in %s
        """
        return Quantity(x, unit).value

    converter.__doc__ %= str(unit)  # pylint: disable=no-member
    return converter
1052295
def as_number(as_number_val):
    """"""
    as_number_str = py23_compat.text_type(as_number_val)
    if "." in as_number_str:
        big, little = as_number_str.split(".")
        return (int(big) << 16) + int(little)
    else:
        return int(as_number_str)
517779
def toFloat(val):
    """"""
    hex = "0123456789abcdef"
    return float(hex.find(val[0]) * 16 + hex.find(val[1]))
639766
function toFloat(val, def) {
    if (is_1.isFloat(val))
        return val;
    if (!is_1.isValue(val))
        return toDefault(null, def);
    var parsed = function_1.tryWrap(parseFloat, val)(def);
    if (is_1.isFloat(parsed) || is_1.isNumber(parsed))
        return parsed;
    if (toBoolean(val))
        return 1;
    return 0;
}
1075674
def p_ConstValue_float(p):
  """"""
  p[0] = model.Value(type=model.Value.FLOAT, value=p[1])
133148
def _bits_to_float(bits, lower=-90.0, middle=0.0, upper=90.0):
  """"""
  for i in bits:
    if i:
      lower = middle
    else:
      upper = middle
    middle = (upper + lower) / 2
  return middle
564150
function floatSafeRemainder(val, step) {
  const valDecCount = (val.toString().split('.')[1] || '').length;
  const stepDecCount = (step.toString().split('.')[1] || '').length;
  const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
  const valInt = parseInt(val.toFixed(decCount).replace('.', ''), 10);
  const stepInt = parseInt(step.toFixed(decCount).replace('.', ''), 10);
  return (valInt % stepInt) / Math.pow(10, decCount);
}
1121791
def standardize_cell_val v
      v = ((float = Float(v)) && (float % 1.0 == 0) ? float.to_i : float) rescue v
      v = v.force_encoding("UTF-8") if v.is_a?(String)
      v
    end