Skip to content

Commit ad318f9

Browse files
committed
handle boundary cases correctly
1 parent 945a74c commit ad318f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/src/com/rabbitmq/examples/MulticastMain.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ private static List<?> lstArg(CommandLine cmd, char opt) {
213213
}
214214

215215
private static String formatRate(double rate) {
216-
if (rate > 10) return String.format("%d", (long) rate);
217-
else if (rate > 1) return String.format("%1.1f", rate);
218-
else return String.format("%1.2f", rate);
216+
if (rate < 1) return String.format("%1.2f", rate);
217+
else if (rate < 10) return String.format("%1.1f", rate);
218+
else return String.format("%d", (long) rate);
219219
}
220220

221221
public static class Producer implements Runnable, ReturnListener,

0 commit comments

Comments
 (0)