@Test public void testFormatMillisWithDecimal() throws Exception { Double input = 500.1d; String output = FormatUtils.formatMillisOrSeconds(input); assertThat(output, equalTo("500.1ms")); }
public static String formatMillisOrSeconds(Number value) { if (value.doubleValue() < 1000) { return decimalFormatSeconds.get().format(value) + "ms"; } else { return decimalFormatSeconds.get().format(value.doubleValue()/1000) + "s"; } }
FormatUtils { public static String formatMillisOrSeconds(Number value) { if (value.doubleValue() < 1000) { return decimalFormatSeconds.get().format(value) + "ms"; } else { return decimalFormatSeconds.get().format(value.doubleValue()/1000) + "s"; } } }
FormatUtils { public static String formatMillisOrSeconds(Number value) { if (value.doubleValue() < 1000) { return decimalFormatSeconds.get().format(value) + "ms"; } else { return decimalFormatSeconds.get().format(value.doubleValue()/1000) + "s"; } } private  FormatUtils(); }
FormatUtils { public static String formatMillisOrSeconds(Number value) { if (value.doubleValue() < 1000) { return decimalFormatSeconds.get().format(value) + "ms"; } else { return decimalFormatSeconds.get().format(value.doubleValue()/1000) + "s"; } } private  FormatUtils(); static ZonedDateTime parseUTCTime(String value); static Number parseNumber(String value); static String formatNumber(Number value); static String formatNumberFiveCharLimit(Number value); static String formatMillisOrSeconds(Number value); static String generateDefaultValueMessage(String metric, Number value); }
FormatUtils { public static String formatMillisOrSeconds(Number value) { if (value.doubleValue() < 1000) { return decimalFormatSeconds.get().format(value) + "ms"; } else { return decimalFormatSeconds.get().format(value.doubleValue()/1000) + "s"; } } private  FormatUtils(); static ZonedDateTime parseUTCTime(String value); static Number parseNumber(String value); static String formatNumber(Number value); static String formatNumberFiveCharLimit(Number value); static String formatMillisOrSeconds(Number value); static String generateDefaultValueMessage(String metric, Number value);  }