We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 603918d commit 2617fb4Copy full SHA for 2617fb4
ballerina/clockhands.bal
@@ -4,7 +4,10 @@ public function main() {
4
foreach int i in 0...10 {
5
int t = (43200 * i + 21600) / 11;
6
int h = t / 3600;
7
- int m = t % 3600;
8
- io:println(`${h == 0 ? 12 : h.toString().padZero(2)}:${(m / 60).toString().padZero(2)}:${(m % 60).toString().padZero(2)}`);
+ int m = t / 60 % 60;
+ int s = t % 60;
9
+ io:println((h == 0 ? "12" : h.toString().padZero(2)) + ":"
10
+ + (m).toString().padZero(2) + ":"
11
+ + (s).toString().padZero(2));
12
}
13
0 commit comments