7 kyu

Convert Decimal Degrees to Degrees, Minutes, Seconds

263 of 515danieldauk

Description:

Convert Decimal Degrees to Degrees, Minutes, Seconds.

Remember: 1 degree = 60 minutes; 1 minute = 60 seconds.

Input: Positive number.

Output: Array [degrees, minutes, seconds]. E.g [30, 25, 25]

Trailing zeroes should be omitted in the output. E.g

convert (50) 
//correct output -> [50] 
//wrong output -> [50, 0, 0]

convert(80.5)
//correct output -> [ 80, 30 ]
//wrong output -> [80, 30, 0]

convert(0.0001388888888888889)
//correct output -> [ 0, 0, 1 ]
//wrong output -> [1]

Round the seconds to the nearest integer.

Fundamentals

Stats:

CreatedMay 4, 2017
PublishedMay 4, 2017
Warriors Trained1569
Total Skips32
Total Code Submissions3459
Total Times Completed515
JavaScript Completions263
Python Completions275
Total Stars26
% of votes with a positive feedback rating71% of 111
Total "Very Satisfied" Votes67
Total "Somewhat Satisfied" Votes24
Total "Not Satisfied" Votes20
Total Rank Assessments22
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • danieldauk Avatar
  • albertogcmr Avatar
  • ejini战神 Avatar
  • Rud1 Avatar
  • RileyHunter Avatar
Ad