Converts a number to its ordinal as a string.

<p>

E.g. 1 becomes '1st', 2 becomes '2nd', 3 becomes '3rd', etc.

@param value
The number to convert
@return String representing the number as ordinal
421347
public static String ordinal(Number value)
    {
        int v = value.intValue();
        int vc = v % 100;

        if (vc > 10 && vc < 14)
            return String.format(ORDINAL_FMT, v, context.get().ordinalSuffix(0));

        return String.format(ORDINAL_FMT, v, context.get().ordinalSuffix(v % 10));
    }
585493
public static String formatPluralCurrency(final Number value)
    {
        DecimalFormat decf = context.get().getPluralCurrencyFormat();
        return stripZeros(decf, decf.format(value));
    }
16096
private boolean isNumeric(String value) {

        if (!CmsStringUtil.isEmpty(value)) {
            NumberFormat formatter = NumberFormat.getInstance();
            ParsePosition pos = new ParsePosition(0);
            formatter.parse(value, pos);
            return value.length() == pos.getIndex();
        } else {
            return false;
        }
    }
262660
private static Number asNumber(Object value) {
    Number num = null;
    if (value == null) {
      num = null;
    } else if (value instanceof Number) {
      num = (Number) value;
    } else if (value instanceof Boolean) {
      num = ((Boolean) value) ? 1 : 0;
    }
    return num;
  }
433774
public static String getValueLabel(final Object value) {
        if (value == null) {
            return NULL_LABEL;
        }

        if (value instanceof HasLabelAdvice) {
            final String suggestedLabel = ((HasLabelAdvice) value).getSuggestedLabel();
            if (!Strings.isNullOrEmpty(suggestedLabel)) {
                return suggestedLabel;
            }
        }

        // format decimals
        if (value instanceof Double || value instanceof Float || value instanceof BigDecimal) {
            final NumberFormat format = NumberFormat.getNumberInstance();
            final String result = format.format((Number) value);
            logger.debug("Formatted decimal {} to: {}", value, result);
            return result;
        }

        // format dates
        if (value instanceof Date) {
            final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            final String result = format.format((Date) value);
            logger.debug("Formatted date {} to: {}", value, result);
            return result;
        }

        return getLabel(value.toString());
    }
248470
public static final BigDecimal printUnits(Number value)
   {
      return (value == null ? BIGDECIMAL_ONE : new BigDecimal(value.doubleValue() / 100));
   }
899986
public static String ordinalize(int number){
        int modulo = number%100;
        if(modulo>=11 && modulo<=13)
            return number+"th";
        switch(number%10){
            case 1:
                return number+"st";
            case 2:
                return number+"nd";
            case 3:
                return number+"rd";
            default:
                return number+"th";
        }
    }
923324
public static CmsListOrderEnum valueOf(String value) throws CmsIllegalArgumentException {

        Iterator<CmsListOrderEnum> iter = VALUES.iterator();
        while (iter.hasNext()) {
            CmsListOrderEnum target = iter.next();
            if (value.equals(target.getOrder())) {
                return target;
            }
        }
        throw new CmsIllegalArgumentException(
            Messages.get().container(
                Messages.ERR_LIST_ENUM_PARSE_2,
                new Integer(value),
                CmsListOrderEnum.class.getName()));
    }
1281024
protected String replace4Digits(final String value) {

        // 桁ごとに変換を行う。
        final int length = value.length();
        final List<String> digits = new ArrayList<>();

        for(int i=0; i < length; i++) {
            // 下の桁から処理する
            final char c = value.charAt(length-i-1);
            if(c == '0') {
                continue;

            }

            String item;
            if(c == '1' && i > 0) {
                // 10の位以上で、かつ1の場合、数字部分は省略し、桁数のみにする。
                item = digits4Map[i];
            } else {
                item = replaceSimple(String.valueOf(c)) + digits4Map[i];
            }

            digits.add(item);

        }

        /*
         * 文字列に直す。
         * ・桁数が逆順になっているので、戻し結合する。
         */
        Collections.reverse(digits);
        StringBuilder sb = new StringBuilder();
        for(String item : digits) {
            sb.append(item);
        }

        return sb.toString();

    }
415846
public String p(double value ) {
        return UtilEjml.fancyString(value,format,false,length,significant);
    }
1060922
private static Object toNumber( String value)
    {
    Object number;

    try
      {
      number = toExternalNumber( new BigDecimal( value));
      }
    catch( Exception e)
      {
      number = null;
      }

    return number;
    }
936168
public String ordinal(long n) {
        if (n == 0) {
            return "zeroth";
        }

        StringBuilder buffer = new StringBuilder(20);

        if (n < 0) {
            buffer.append("negative ");
            n = -n;
        }

        n = cardinalGroup(buffer, n, 1000000000000000000L, "quintillion");
        n = cardinalGroup(buffer, n, 1000000000000000L, "quadrillion");
        n = cardinalGroup(buffer, n, 1000000000000L, "trillion");
        n = cardinalGroup(buffer, n, 1000000000L, "billion");
        n = cardinalGroup(buffer, n, 1000000L, "million");
        n = cardinalGroup(buffer, n, 1000L, "thousand");

        if (n == 0) {
            buffer.append("th");
        }
        else {
            cardinal999(buffer, n, true);
        }

        return buffer.toString();
    }
1073332
public Integer convertStringToInteger(String value) {
        Integer result;
        try {
            result = Integer.valueOf(value);
        } catch (NumberFormatException e) {
            result = DEFAULT_INT_VALUE;
        }
        return result;

    }
1047630
public static CharSequence toParameterValue(final Long value) {
        return value != null ? Long.toString(value) : Attr.nullValue();
    }
913495
public String ordinal(Long n) {
        return (n == null) ? null : ordinal(n.longValue());
    }
787795
public T convert(Object value)
    {
        T result = null;
        if (value != null)
        {
            if (getValueClass().isInstance(value))
                result = getValueClass().cast(value);
            else
                result = convertFromString(value.toString());
        }
        return result;
    }
663263
public static final Number parseUnits(Number value)
   {
      return (value == null ? null : NumberHelper.getDouble(value.doubleValue() * 100));
   }