Skip to content

Commit 64e56f7

Browse files
committed
Updates on time format to answer question
1 parent 744b0a7 commit 64e56f7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Sprint-1/3-mandatory-interpret/2-time-format.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const movieLength = 8784; // length of movie in seconds
1+
const movieLength = 8784 // length of movie in seconds
22

33
const remainingSeconds = movieLength % 60;
44
const totalMinutes = (movieLength - remainingSeconds) / 60;
@@ -28,4 +28,7 @@ console.log(result);
2828
// The variable result shows the total remaining duration of a movie in terms of hours, minutes and seconds. We can also call it remainingTime.
2929

3030
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
31-
// The movieLength code will work work with all kinds of number. That is integers and floats. It will not work with strings
31+
// When using -8784, I had the same answers with 8784, except they were all negative numbers. -2:-26:-24
32+
// When using 87.84, I had 0:1:27.840000000000003 which is still a readable time. But it doesn't round up the decimal numbers.
33+
// When using the String "8784", I had 2:26:24 which is the same answer as when I used 8784. Javascript is converts strings to integers automatically when subtracting
34+
// When using the string "hello", I get the outcome NaN:NaN:NaN which means "Not a Number". the string hello can't work in divisions.

0 commit comments

Comments
 (0)