Return parsed decimal part

 @return [Integer, Float]

 @api private
 @since 0.0.1
500011
def parse_decimal_part(str)
      map = if str.index('割')
              Numeja::JA_割合用小数
            else
              Numeja::JA_小数
            end
      keys = map.keys()
      keys.reduce(0) do |t, ja_digit|
        index = str.index(ja_digit)
        break t if index.nil?
        unit = str.slice!(0, index)
        str.slice!(0, 1)
        t += (unit.to_f * map[ja_digit])
        t
      end
    end
648943
def parse_from
      s0 = @current_pos
      s1 = match_str("打")
      if s1 != :failed
        @reported_pos = s0
        s1 = nil
      end
      s0 = s1
      if s0 == :failed
        s0 = @current_pos
        if match_str("(") != :failed
          s2 = match_regexp(/^[1-9]/)
          if s2 != :failed
            s3 = match_regexp(/^[1-9]/)
            if s3 != :failed
              if match_str(")") != :failed
                @reported_pos = s0
                s0 = { "x" => s2.to_i, "y" => s3.to_i }
              else
                @current_pos = s0
                s0 = :failed
              end
            else
              @current_pos = s0
              s0 = :failed
            end
          else
            @current_pos = s0
            s0 = :failed
          end
        else
          @current_pos = s0
          s0 = :failed
        end
      end
      s0
    end
468352
def decimal_to_alpha(dec):
    
    dec /= 100.0
    alpha =  hex(int(dec*65535))[2:]
    while len(alpha) < 4:
        alpha = '0' + alpha
    return alpha
1327447
def decimal(attr, metadata={})
      add_attribute(attr, :decimal, metadata)
      define_method("#{attr}=") do |arg|
        instance_variable_set("@#{attr}", arg.nil? ? nil : BigDecimal.new(arg.to_s))
      end
    end
1047482
def parse_value(val):
    
    val = val.replace("%", " ")\
        .replace(" ","")\
        .replace(",", ".")\
        .replace("st","").strip()

    missing = ["Ejdeltagit", "N/A"]
    if val in missing:
        return val
    elif val == "":
        return None

    return float(val)
841596
public float parseFloat() {
		int mant = 0;
		int mantDig = 0;
		boolean mantPos = true;
		boolean mantRead = false;

		int exp = 0;
		int expDig = 0;
		int expAdj = 0;
		boolean expPos = true;

		switch (current) {
		case '-':
			mantPos = false;
			// fallthrough
		case '+':
			current = read();
		}

		m1: switch (current) {
		default:
			return Float.NaN;

		case '.':
			break;

		case '0':
			mantRead = true;
			l: for (;;) {
				current = read();
				switch (current) {
				case '1':
				case '2':
				case '3':
				case '4':
				case '5':
				case '6':
				case '7':
				case '8':
				case '9':
					break l;
				case '.':
				case 'e':
				case 'E':
					break m1;
				default:
					return 0.0f;
				case '0':
				}
			}

		case '1':
		case '2':
		case '3':
		case '4':
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
			mantRead = true;
			l: for (;;) {
				if (mantDig < 9) {
					mantDig++;
					mant = mant * 10 + (current - '0');
				} else {
					expAdj++;
				}
				current = read();
				switch (current) {
				default:
					break l;
				case '0':
				case '1':
				case '2':
				case '3':
				case '4':
				case '5':
				case '6':
				case '7':
				case '8':
				case '9':
				}
			}
		}

		if (current == '.') {
			current = read();
			m2: switch (current) {
			default:
			case 'e':
			case 'E':
				if (!mantRead) {
					reportUnexpectedCharacterError(current);
					return 0.0f;
				}
				break;

			case '0':
				if (mantDig == 0) {
					l: for (;;) {
						current = read();
						expAdj--;
						switch (current) {
						case '1':
						case '2':
						case '3':
						case '4':
						case '5':
						case '6':
						case '7':
						case '8':
						case '9':
							break l;
						default:
							if (!mantRead) {
								return 0.0f;
							}
							break m2;
						case '0':
						}
					}
				}
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':
				l: for (;;) {
					if (mantDig < 9) {
						mantDig++;
						mant = mant * 10 + (current - '0');
						expAdj--;
					}
					current = read();
					switch (current) {
					default:
						break l;
					case '0':
					case '1':
					case '2':
					case '3':
					case '4':
					case '5':
					case '6':
					case '7':
					case '8':
					case '9':
					}
				}
			}
		}

		switch (current) {
		case 'e':
		case 'E':
			current = read();
			switch (current) {
			default:
				reportUnexpectedCharacterError(current);
				return 0f;
			case '-':
				expPos = false;
			case '+':
				current = read();
				switch (current) {
				default:
					reportUnexpectedCharacterError(current);
					return 0f;
				case '0':
				case '1':
				case '2':
				case '3':
				case '4':
				case '5':
				case '6':
				case '7':
				case '8':
				case '9':
				}
			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':
			}

			en: switch (current) {
			case '0':
				l: for (;;) {
					current = read();
					switch (current) {
					case '1':
					case '2':
					case '3':
					case '4':
					case '5':
					case '6':
					case '7':
					case '8':
					case '9':
						break l;
					default:
						break en;
					case '0':
					}
				}

			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':
				l: for (;;) {
					if (expDig < 3) {
						expDig++;
						exp = exp * 10 + (current - '0');
					}
					current = read();
					switch (current) {
					default:
						break l;
					case '0':
					case '1':
					case '2':
					case '3':
					case '4':
					case '5':
					case '6':
					case '7':
					case '8':
					case '9':
					}
				}
			}
		default:
		}

		if (!expPos) {
			exp = -exp;
		}
		exp += expAdj;
		if (!mantPos) {
			mant = -mant;
		}

		return buildFloat(mant, exp);
	}
316594
function toPercent(parsedNumber) {
    // if the number is 0, don't do anything
    if (parsedNumber.digits[0] === 0) {
        return parsedNumber;
    }
    // Getting the current number of decimals
    var fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
    if (parsedNumber.exponent) {
        parsedNumber.exponent += 2;
    }
    else {
        if (fractionLen === 0) {
            parsedNumber.digits.push(0, 0);
        }
        else if (fractionLen === 1) {
            parsedNumber.digits.push(0);
        }
        parsedNumber.integerLen += 2;
    }
    return parsedNumber;
}
1269238
def floating_point(
        element_name,  # type: Text
        attribute=None,  # type: Optional[Text]
        required=True,  # type: bool
        alias=None,  # type: Optional[Text]
        default=0.0,  # type: Optional[float]
        omit_empty=False,  # type: bool
        hooks=None  # type: Optional[Hooks]
):
    # type: (...) -> Processor
    
    value_parser = _number_parser(float)
    return _PrimitiveValue(
        element_name,
        value_parser,
        attribute,
        required,
        alias,
        default,
        omit_empty,
        hooks
    )
390835
def valueAt(self, percent):
        
        values = self.values()
        if percent < 0:
            index = 0
        elif percent > 1:
            index = -1
        else:
            index = percent * (len(values) - 1)
        
        # allow some floating point errors for the index (30% left or right)
        remain = index % 1
        if remain < 0.3 or 0.7 < remain:
            try:
                return values[int(round(index))]
            except IndexError:
                return None
        return None
957947
def parse_integer_part(input)
      total = 0
      tmp = 0
      return input.to_i if input =~ /^[0-9]+$/
      input.gsub(REGEXP_数字, JA_数字).each_char do |s|
        unit_prefix = JA_下数[s]
        unless unit_prefix.nil?
          if tmp > 0
            total += tmp * unit_prefix
            tmp = 0
          else
            total += unit_prefix
          end
        end
        tmp += s.to_i
      end
      total + tmp
    end
1049790
def parse_float(float_str):
    """"""
    factor = __get_factor(float_str)
    if factor != 1:
        float_str = float_str[:-1]

    try:
        return float(float_str.replace(',', '')) * factor
    except ValueError:
        return None
1108033
def round_float(float, places)
      factor = Float(10 * places)
      Float((float * factor).round / factor)
    end
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;
}
531351
private static Integer decimalDigits(Type type)
    {
        if (type instanceof DecimalType) {
            return ((DecimalType) type).getScale();
        }
        return null;
    }
454229
def float_to_decimal(f):
    
    n, d = f.as_integer_ratio()
    numerator, denominator = Decimal(n), Decimal(d)
    ctx = Context(prec=60)
    result = ctx.divide(numerator, denominator)
    while ctx.flags[Inexact]:
        ctx.flags[Inexact] = False
        ctx.prec *= 2
        result = ctx.divide(numerator, denominator)
    return result
381167
def floats(s):
    """"""
    try:
        return float(s)
    except ValueError:
        s = re.sub(r'(\d)\s*\(\d+(\.\d+)?\)', r'\1', s)        # Remove bracketed numbers from end
        s = re.sub(r'(\d)\s*±\s*\d+(\.\d+)?', r'\1', s)        # Remove uncertainties from end
        s = s.rstrip('\'"+-=<>/,.:;!?)]}…∼~≈×*_≥≤')             # Remove trailing punctuation
        s = s.lstrip('\'"+=<>/([{∼~≈×*_≥≤£$€#§')                # Remove leading punctuation
        s = s.replace(',', '')                                 # Remove commas
        s = ''.join(s.split())                                  # Strip whitespace
        s = re.sub(r'(\d)\s*[×x]\s*10\^?(-?\d)', r'\1e\2', s)  # Convert scientific notation
        return float(s)
515509
function getDecimal(value) {
    if (!value) {
        return 0;
    }

    var num = value;
    if (!_.isNumber(value)) {
        var isNeg = ('-' && _.includes(value, '-'));

        var regExp = '[^0-9.]';
        var numString = value.toString().replace(new RegExp(regExp, 'g'), '');

        var numList = numString.split('.');

        // numList will always have at least one value in array because we checked for an empty string earlier.
        numList[0] += '.';
        numString = numList.join('');
        num = parseFloat(numString);

        if (!num) {
            num = 0;
        } else if (isNeg) {
            num *= -1;
        }
    }

    return num;
}