分子の指定した桁以降の値を取得する。
@param digit 1から始まる
@return 存在しない桁の場合は空文字を返す。
490871
public String getNumeratorPartAfter(final int digit) {
        
        final int length = numeratorPart.length();
        if(length < digit || digit <= 0) {
            return "";
        }
        
        return numeratorPart.substring(0, (length - digit + 1));
    }
769864
private List<Integer> extractDigits(final String value) throws NumberFormatException {
    final List<Integer> digits = new ArrayList<>(value.length());
    final char[] chars = value.toCharArray();
    for (final char c : chars) {
      digits.add(this.extractDigit(c));
    }
    return digits;
  }
438437
protected int getIntValue() {
		if (label.equals(AbcTokens.DIGIT)
				|| label.equals(AbcTokens.DIGITS)) {
			try {
				return Integer.parseInt(value);
			} catch (NumberFormatException nfe) {
				return -1;
			}
		}
		else
			return -1;
	}
1201656
public static String extractDigit(String string) {
        StringBuilder res = new StringBuilder();
        if (HAS_DIGIT_PATTERN.matcher(string).matches()) {
            string = string.replaceAll("(\\s|[a-zA-Z])+", "");
            res = new StringBuilder(string.indexOf("-") == 0 ? "-" : "");
            int dotIdx = string.lastIndexOf(".");
            for (int i = 0; i < string.length(); i++) {
                char c = string.charAt(i);
                if (Character.isDigit(c) || i == dotIdx) {
                    res.append(c);
                }
            }
            if (res.indexOf(ValueConsts.DOT_SIGN) == 0) {
                res.insert(0, "0");
            } else if (res.indexOf(ValueConsts.NEGATIVE_DOT_SIGN) == 0) {
                res = new StringBuilder("-0." + res.substring(2, res.length()));
            }
        }
        return res.toString();
    }
301841
function digit(event) {
    var element = event.element
      , code = event.keyCode || event.which
      , result;

    result = (code >= 48 && code <= 57) || code === 8 || code === 46;
    if (!result) event.preventDefault();

    return {
      allowed: result,
      code: code,
      removal: code === 8 || code === 48
    };
  }
753562
private String digits() {
    StringBuilder sb = new StringBuilder();
    do {
      sb.append(consumeNextCharacter(CharType.DIGIT));
    } while (chars.positiveLookahead(CharType.DIGIT));
    return sb.toString();
  }
127239
function (number, digits) {
    if (typeof number !== "number") { throw "not a number: " + number; }
    var s = number.toString();
    if (number.length > digits) {
      return number.substr(number.length - digits, number.length);
    }
    while (s.length < digits) {
      s = '0' + s;
    }
    return s;
  }
767831
def plus_one_v1(digits):
    
    digits[-1] = digits[-1] + 1
    res = []
    ten = 0
    i = len(digits)-1
    while i >= 0 or ten == 1:
        summ = 0
        if i >= 0:
            summ += digits[i]
        if ten:
            summ += 1
        res.append(summ % 10)
        ten = summ // 10
        i -= 1
    return res[::-1]
497683
private final boolean consumeNumber(char c) throws LazyException{
		boolean floatChar=false;
		if(c==CH_DASH){
			// If the number started with a minus sign it must be followed by at least one digit
			n++;
			c=cbuf[n];
			if(c<CH_0 || c>CH_9){
				throw new LazyException("Digit expected",n);
			}
		}
		n++;
		if(c==CH_0){
			// First digit was zero - next may not be digit!
			c=cbuf[n];
			if(c>=CH_0 && c<=CH_9){
				throw new LazyException("Number may not start with leading zero",n);
			}
		}else{
			c=cbuf[n];
		}
		while(!(c<CH_0 || c>CH_9)){
			n++;
			c=cbuf[n];
		}
		if(c==CH_DOT){
			floatChar=true;
			// The fractional part must contain one or more digits
			n++;
			c=cbuf[n];
			if(c<CH_0 || c>CH_9){
				throw new LazyException("Digit expected",n);
			}
			n++;
			c=cbuf[n];
			while(!(c<CH_0 || c>CH_9)){
				n++;
				c=cbuf[n];
			}
		}
		if(c==CH_e || c==CH_E){
			floatChar=true;
			n++;
			c=cbuf[n];
			if(c==CH_DASH || c==CH_PLUS){
				// We must have at least one digit following this
				n++;
				c=cbuf[n];
				if(c<CH_0 || c>CH_9){
					throw new LazyException("Digit expected",n);
				}
			}else if(c<CH_0 || c>CH_9){
				throw new LazyException("Exponential part expected",n);
			}
			n++;
			c=cbuf[n];
			while(!(c<CH_0 || c>CH_9)){
				n++;
				c=cbuf[n];
			}
		}
		return floatChar;
	}
74761
def grouped_digits(digits)
      unless (digits.size % @base_scale) == 0
        raise "Invalid number of digits for group_digits (#{digits.size} is not a multiple of #{@base_scale})"
      end
      digits.each_slice(@base_scale).map{|group| scaled_digit(group)}
    end
946976
private void digit(StringBuilder rtn) {

	while (cfml.isValidIndex()) {
	    if (!cfml.isCurrentDigit()) break;
	    rtn.append(cfml.getCurrentLower());
	    cfml.next();
	}
    }
869141
private final int load_digits(StringBuilder sb, int c) throws IOException
    {
        if (!IonTokenConstsX.isDigit(c))
        {
            return c;
        }
        sb.append((char) c);

        return readNumeric(sb, Radix.DECIMAL, NumericState.DIGIT);
    }
781574
public static int genLuhn(String number) {
       number = number + "0";
       int s1 = 0, s2 = 0;
       String reverse = new StringBuffer(number).reverse().toString();
       for (int i = 0; i < reverse.length(); i++) {
           int digit = Character.digit(reverse.charAt(i), 10);
           if (i % 2 == 0) {// this is for odd digits, they are 1-indexed in //
                            // the algorithm
               s1 += digit;
           } else {// add 2 * digit for 0-4, add 2 * digit - 9 for 5-9
               s2 += 2 * digit;
               if (digit >= 5) {
                   s2 -= 9;
               }
           }
       }
       int check = 10 - ((s1 + s2) % 10);
       if (check == 10)
           check = 0;
       return check;
   }
839691
@Pure
	public static String formatHex(int amount, int digits) {
		final StringBuffer hex = new StringBuffer(Integer.toHexString(amount));
		while (hex.length() < digits) {
			hex.insert(0, "0"); //$NON-NLS-1$
		}
		return hex.toString();
	}
14150
public static String getDigitsOnly(String s) {
        if (isEmpty(s)) return s;
        String rslt = s.trim();
        if (isEmpty(rslt)) return rslt;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < rslt.length(); i++) {
            char ch = rslt.charAt(i);
            if (Character.isDigit(ch)) sb.append(ch);
        }
        return sb.toString();
    }
1238029
private static String intToString(int value, int digit) {
        StringBuilder stringBuilder = new StringBuilder(digit);
        stringBuilder.append(Integer.toString(value));
        while (stringBuilder.length() < digit) {
            stringBuilder.insert(0, "0");
        }
        return stringBuilder.toString();
    }
800545
static boolean containsNoDigit(final String s) {
    for (int k = 0; k < s.length(); k++) {
      if (Character.isDigit(s.charAt(k))) {
        return false;
      }
    }
    return true;
  }