throws NumberFormatException
171238
private static int getMainNumber(int mainNumber, String dptID)
	{
		return mainNumber != 0 ? mainNumber : Integer.parseInt(dptID.substring(0, dptID
			.indexOf('.')));
	}
575531
@SuppressWarnings("squid:S3655")
    public String getNummerFormatted() {
        if (!this.getNummer().isPresent()) {
            throw new IllegalStateException("no number present");
        }
        BigInteger hundert = BigInteger.valueOf(100);
        StringBuilder formatted = new StringBuilder();
        for (BigInteger i = this.getNummer().get(); i.compareTo(BigInteger.ONE) > 0; i = i.divide(hundert)) {
            formatted.insert(0, " " + i.remainder(hundert));
        }
        return formatted.toString().trim();
    }
591620
private void writeValue(Object value) throws JSONException {
        if (value instanceof Number) {
            String string = JSONObject.numberToString((Number) value);
            int integer = this.valuekeep.find(string);
            if (integer != none) {
                write(2, 2);
                write(integer, this.valuekeep);
                return;
            }
            if (value instanceof Integer || value instanceof Long) {
                long longer = ((Number) value).longValue();
                if (longer >= 0 && longer < int14) {
                    write(0, 2);
                    if (longer < int4) {
                        zero();
                        write((int) longer, 4);
                        return;
                    }
                    one();
                    if (longer < int7) {
                        zero();
                        write((int)(longer - int4), 7);
                        return;
                    }
                    one();
                    write((int)(longer - int7), 14);
                    return;
                }
            }
            write(1, 2);
            for (int i = 0; i < string.length(); i += 1) {
                write(bcd(string.charAt(i)), 4);
            }
            write(endOfNumber, 4);
            this.valuekeep.register(string);
        } else {
            write(3, 2);
            writeJSON(value);
        }
    }
1264457
private static void formatNumber(int n, String type, StringBuilder to) {
    checkArgument(n > 0);
    to.append(n).append(' ').append(type).append(n == 1 ? "" : "s");
  }
720186
public boolean bool() throws javax.xml.transform.TransformerException
  {

    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NUMBER,
          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a number");

    return false;
  }
1069269
private Integer toNumber(final Object src) {

		if (src instanceof Number) {

			return ((Number)src).intValue();
		}

		if (src instanceof String) {

			try {

				return Integer.valueOf(src.toString());

			} catch (NumberFormatException nfex) {
				logger.warn("Error in slice(): Cannot parse number {}.", src);
			}
		}

		return null;
	}
985044
public Number getNumber(String key) throws NumberFormatException {
        String value = getString(key);
        if (value == null) {
            return null;
        }
        else {
            try {
                return Integer.valueOf(value);
            }
            catch (NumberFormatException e) {
            }
            try {
                return Long.valueOf(value);
            }
            catch (NumberFormatException e) {
            }
            return Double.valueOf(value);
        }
    }
355738
private static long longValue(Object attributeValue)
         throws NumberFormatException {

        if (attributeValue instanceof Number) {
            return (((Number) attributeValue).longValue());
        } else {
            return (Long.parseLong(attributeValue.toString()));
        }

    }
1117784
public double num()
    throws javax.xml.transform.TransformerException
  {

    XMLString s = xstr();

    return s.toDouble();
  }
1114605
static int readInt(String location) throws IOException {
        BufferedReader r = new BufferedReader(new FileReader(location));
        String s = r.readLine();
        r.close();
        try {
            if (s != null && s.length() > 0) {
                return Integer.parseInt(s);
            } else {
                throw new IOException(location + " does not contain an integer");
            }
        } catch (NumberFormatException e) {
            throw new IOException(
                    location + " does not contain an integer ('" + s + "'");
        }
    }
149853
protected Number parseInteger(String string) throws ParseException {
		try {
			return Long.valueOf(string);
		} catch (NumberFormatException e) {
			fail(INTEGER);
			return null;
		}
	}
238276
public long getNum(Object obj) throws IllegalArgumentException,
			IllegalAccessException, InvocationTargetException,
			BeanPropertyException, NoSuchMethodException {
		switch (getTypeCode()) {
		case SHORT:
			if (m_f != null)
				return (long) m_f.getShort(obj);
			if (m_mGet != null)
				return ((Short) m_mGet.invoke(obj, EMPTYOBJECTARRAY))
						.shortValue();
			break;
		case INTEGER:
			if (m_f != null)
				return (long) m_f.getInt(obj);
			if (m_mGet != null)
				return ((Integer) m_mGet.invoke(obj, EMPTYOBJECTARRAY))
						.intValue();
			break;
		case LONG:
			if (m_f != null)
				return m_f.getLong(obj);
			if (m_mGet != null)
				return ((Long) m_mGet.invoke(obj, EMPTYOBJECTARRAY))
						.longValue();
			break;
		default:
			throw new BeanPropertyException("Property is not numeric.");
		}

		throw new BeanPropertyException("Try to read write-only property.");
	}
1359340
public final void mDecimalLiteral() throws RecognitionException {
		try {
			int _type = DecimalLiteral;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:16: ( ( '0' | NonZeroDigit ( ( Digits )? | Underscores Digits ) ) ( IntegerTypeSuffix )? )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:18: ( '0' | NonZeroDigit ( ( Digits )? | Underscores Digits ) ) ( IntegerTypeSuffix )?
			{
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:18: ( '0' | NonZeroDigit ( ( Digits )? | Underscores Digits ) )
			int alt5=2;
			int LA5_0 = input.LA(1);
			if ( (LA5_0=='0') ) {
				alt5=1;
			}
			else if ( ((LA5_0 >= '1' && LA5_0 <= '9')) ) {
				alt5=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 5, 0, input);
				throw nvae;
			}

			switch (alt5) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:19: '0'
					{
					match('0'); 
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:25: NonZeroDigit ( ( Digits )? | Underscores Digits )
					{
					mNonZeroDigit(); 

					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:38: ( ( Digits )? | Underscores Digits )
					int alt4=2;
					int LA4_0 = input.LA(1);
					if ( (LA4_0=='_') ) {
						alt4=2;
					}

					else {
						alt4=1;
					}

					switch (alt4) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:39: ( Digits )?
							{
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:39: ( Digits )?
							int alt3=2;
							int LA3_0 = input.LA(1);
							if ( ((LA3_0 >= '0' && LA3_0 <= '9')) ) {
								alt3=1;
							}
							switch (alt3) {
								case 1 :
									// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:39: Digits
									{
									mDigits(); 

									}
									break;

							}

							}
							break;
						case 2 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:49: Underscores Digits
							{
							mUnderscores(); 

							mDigits(); 

							}
							break;

					}

					}
					break;

			}

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1304:70: ( IntegerTypeSuffix )?
			int alt6=2;
			int LA6_0 = input.LA(1);
			if ( (LA6_0=='L'||LA6_0=='l') ) {
				alt6=1;
			}
			switch (alt6) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:
					{
					if ( input.LA(1)=='L'||input.LA(1)=='l' ) {
						input.consume();
					}
					else {
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;

			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
55017
public function assertIsNumericAndNonZero($value, $message='%s must be a number and not 0', $exception='Asserts')
    {
        if (is_numeric($value) === false || floatval($value) <= 0) {
            $this->throwException($exception, $message, $value);
        }
    }
209392
public int toInteger() throws NumberFormatException {
        int res = 0;
        byte currChar;
        int i=1;
        currChar=chars[pos];
        boolean isMinus=false;
        
        if(currChar==minus_byte)
        	isMinus=true;
        else if(currChar>=zero_byte && currChar<=nine_byte)
    		res+=currChar-zero_byte;
    	else
    		throw new NumberFormatException("value is not numeric");
    	
        for (; i < len; i++) {
        	currChar=chars[pos+i];        		
        	if(currChar>=zero_byte && currChar<=nine_byte)
        	{
        		res*=10;
        		res+=currChar-zero_byte;
        	}        
        	else
        		throw new NumberFormatException("value is not numeric");
        }
        
        if(isMinus)
        	return 0-res;
        else
        	return res;
    }
249745
@Override
    public int print(
        ChronoDisplay formattable,
        Appendable buffer,
        AttributeQuery attributes,
        Set<ElementPosition> positions, // optional
        boolean quickPath
    ) throws IOException {

        int value = formattable.getInt(this.element);

        if (value < 0) {
            if (value == Integer.MIN_VALUE) {
                return -1;
            } else {
                throw new IllegalArgumentException(
                    "Cannot format negative ordinal numbers: " + formattable);
            }
        }

        String digits = Integer.toString(value);

        char zeroChar = (
            quickPath
                ? this.zeroDigit
                : attributes.get(Attributes.ZERO_DIGIT, Character.valueOf('0')).charValue());

        if (zeroChar != '0') {
            int diff = zeroChar - '0';
            char[] characters = digits.toCharArray();

            for (int i = 0; i < characters.length; i++) {
                characters[i] = (char) (characters[i] + diff);
            }

            digits = new String(characters);
        }

        int start = -1;
        int printed = 0;

        if (buffer instanceof CharSequence) {
            start = ((CharSequence) buffer).length();
        }

        buffer.append(digits);
        printed += digits.length();

        String indicator = this.getIndicator(attributes, quickPath, value);
        buffer.append(indicator);
        printed += indicator.length();

        if (
            (start != -1)
            && (printed > 0)
            && (positions != null)
        ) {
            positions.add(
                new ElementPosition(this.element, start, start + printed));
        }

        return printed;

    }
454162
public static UByte valueOf(String value) throws NumberFormatException {
        return valueOfUnchecked(rangeCheck(Short.parseShort(value)));
    }