TimePlotLabeler: Fix format strings

master
Harald Wolff 2018-02-14 19:57:22 +01:00
parent b8bfe0c52c
commit daab8c34d8
1 changed files with 4 additions and 4 deletions

View File

@ -43,10 +43,10 @@ public class TimePlotLabeler implements PlotLabeler{
second = (int)(pos * 1) % 60;
millisecond = (int)(pos * 1000) % 1000;
String sh, sm, ss, sms;
sh = hour < 10? String.format("0%d", hour) : String.format("%d", hour);
sm = minute < 10? String.format("0%d", minute) : String.format("%d", minute);
ss = second < 10? String.format("0%d", second) : String.format("%d", second);
sms = millisecond < 10? String.format("00%d", millisecond) : millisecond < 100? String.format("0%d", millisecond) : String.format("%d", millisecond);
sh = String.format("%02d", hour);
sm = String.format("%02d", minute);
ss = String.format("%02d", second);
sms = String.format("%03d", millisecond);
return sh + ":" + sm + ":" + ss + "." + sms;
}