/** * Converts the specified object to a number and formats it according to * the pattern or style returned by {@link #getFormat()}. * * @param obj the number object to be formatted * @return the specified number formatted as a string * @see #format(String format, Object obj, Locale locale) */ public String format(Object obj) { return format(getFormat(), obj); }
/** * 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()); }