class MillisecondsSpentNumberFormat extends NumberFormat {

    private static final long DAY_MILLIS = 3600000L * 24L;
    private static final long HOUR_MILLIS = 3600000L;
    private static final long MINUTE_MILLIS = 60000L;
    private static final long SECOND_MILLIS = 1000L;

    private final Locale locale;

    public MillisecondsSpentNumberFormat(Locale locale) {
        this.locale = locale;
    }

    @Override
    public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) {
        return format((long) number, toAppendTo, pos);
    }

    @Override
    public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos) {<FILL_FUNCTION_BODY>}

    @Override
    public Number parse(String source, ParsePosition parsePosition) {
        throw new UnsupportedOperationException();
    }

}

        if (number == 0L) {
            toAppendTo.append("0");
        }
        long rest = number;
        long days = rest / DAY_MILLIS;
        if (days > 0) {
            toAppendTo.append(days).append("d");
            rest %= DAY_MILLIS;
        }
        long hours = rest / HOUR_MILLIS;
        if (hours > 0) {
            toAppendTo.append(hours).append("h");
            rest %= HOUR_MILLIS;
        }
        long minutes = rest / MINUTE_MILLIS;
        if (minutes > 0) {
            toAppendTo.append(minutes).append("m");
            rest %= MINUTE_MILLIS;
        }
        long seconds = rest / SECOND_MILLIS;
        if (seconds > 0) {
            toAppendTo.append(seconds).append("s");
            rest %= SECOND_MILLIS;
        }
        if (rest > 0) {
            toAppendTo.append(rest).append("ms");
        }
        return toAppendTo;
    
<methods>public java.lang.Object clone() ,public boolean equals(java.lang.Object) ,public final java.lang.String format(double) ,public final java.lang.String format(long) ,public java.lang.StringBuffer format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition) ,public abstract java.lang.StringBuffer format(double, java.lang.StringBuffer, java.text.FieldPosition) ,public abstract java.lang.StringBuffer format(long, java.lang.StringBuffer, java.text.FieldPosition) ,public static java.util.Locale[] getAvailableLocales() ,public static java.text.NumberFormat getCompactNumberInstance() ,public static java.text.NumberFormat getCompactNumberInstance(java.util.Locale, java.text.NumberFormat.Style) ,public java.util.Currency getCurrency() ,public static final java.text.NumberFormat getCurrencyInstance() ,public static java.text.NumberFormat getCurrencyInstance(java.util.Locale) ,public static final java.text.NumberFormat getInstance() ,public static java.text.NumberFormat getInstance(java.util.Locale) ,public static final java.text.NumberFormat getIntegerInstance() ,public static java.text.NumberFormat getIntegerInstance(java.util.Locale) ,public int getMaximumFractionDigits() ,public int getMaximumIntegerDigits() ,public int getMinimumFractionDigits() ,public int getMinimumIntegerDigits() ,public static final java.text.NumberFormat getNumberInstance() ,public static java.text.NumberFormat getNumberInstance(java.util.Locale) ,public static final java.text.NumberFormat getPercentInstance() ,public static java.text.NumberFormat getPercentInstance(java.util.Locale) ,public java.math.RoundingMode getRoundingMode() ,public int hashCode() ,public boolean isGroupingUsed() ,public boolean isParseIntegerOnly() ,public java.lang.Number parse(java.lang.String) throws java.text.ParseException,public abstract java.lang.Number parse(java.lang.String, java.text.ParsePosition) ,public final java.lang.Object parseObject(java.lang.String, java.text.ParsePosition) ,public void setCurrency(java.util.Currency) ,public void setGroupingUsed(boolean) ,public void setMaximumFractionDigits(int) ,public void setMaximumIntegerDigits(int) ,public void setMinimumFractionDigits(int) ,public void setMinimumIntegerDigits(int) ,public void setParseIntegerOnly(boolean) ,public void setRoundingMode(java.math.RoundingMode) <variables>private static final int COMPACTSTYLE,private static final int CURRENCYSTYLE,public static final int FRACTION_FIELD,private static final int INTEGERSTYLE,public static final int INTEGER_FIELD,private static final int NUMBERSTYLE,private static final int PERCENTSTYLE,private static final int SCIENTIFICSTYLE,static final int currentSerialVersion,private boolean groupingUsed,private byte maxFractionDigits,private byte maxIntegerDigits,private int maximumFractionDigits,private int maximumIntegerDigits,private byte minFractionDigits,private byte minIntegerDigits,private int minimumFractionDigits,private int minimumIntegerDigits,private boolean parseIntegerOnly,private int serialVersionOnStream,static final long serialVersionUID