6 kyu
Binary Coded Decimal
73 of 817chipit24
Description:
Convert a number to a binary coded decimal (BCD).
You can assume input will always be an integer. If it is a negative number then simply place a minus sign in front of the output string. Output will be a string with each digit of the input represented as 4 bits (0 padded) with a space between each set of 4 bits.
Ex.
n = 10 -> "0001 0000"
n = -10 -> "-0001 0000"
Algorithms
Similar Kata:
Stats:
Created | Apr 6, 2015 |
Published | Apr 6, 2015 |
Warriors Trained | 1525 |
Total Skips | 74 |
Total Code Submissions | 3019 |
Total Times Completed | 817 |
Ruby Completions | 73 |
JavaScript Completions | 371 |
Python Completions | 397 |
Julia Completions | 6 |
Total Stars | 18 |
% of votes with a positive feedback rating | 90% of 187 |
Total "Very Satisfied" Votes | 155 |
Total "Somewhat Satisfied" Votes | 27 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 21 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |