/** * Converts an object to an instance of {@link Number} using the * specified format and the {@link Locale} returned by * {@link #getLocale()} if the object is not already an instance * of Number. * * @param format - the format the number is in * @param obj - the number to convert * @return the object as a {@link Number} or <code>null</code> if no * conversion is possible * @see #toNumber(String format, Object obj, Locale locale) */ public Number toNumber(String format, Object obj) { return toNumber(format, obj, getLocale()); }
/** * Converts the specified object to a number and returns * a formatted string representing that number in the locale * returned by {@link #getLocale()}. * * @param format the formatting instructions * @param obj the number object to be formatted * @return a formatted string for this locale representing the specified * number or <code>null</code> if the parameters are invalid * @see #format(String format, Object obj, Locale locale) */ public String format(String format, Object obj) { return format(format, obj, getLocale()); }
/** * Converts an object to an instance of {@link Number} using the * format returned by {@link #getFormat()} and the {@link Locale} * returned by {@link #getLocale()} if the object is not already * an instance of Number. * * @param obj the number to convert * @return the object as a {@link Number} or <code>null</code> if no * conversion is possible */ public Number toNumber(Object obj) { return toNumber(getFormat(), obj, getLocale()); }