6 kyu
Group Repeating Fractions
179 of 362joh_pot
Description:
Write
function repeatingFractions(numerator, denominator)
that given two numbers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part has repeated digits, replace those digits with a single digit in parentheses.
For example:
repeatingFractions(1,1) === '1'
repeatingFractions(1,3) === '0.(3)'
repeatingFractions(2,888) === '0.(0)(2)5(2)5(2)5(2)5(2)5(2)'
Strings
Fundamentals
Similar Kata:
Stats:
Created | Oct 6, 2015 |
Published | Oct 6, 2015 |
Warriors Trained | 872 |
Total Skips | 55 |
Total Code Submissions | 1560 |
Total Times Completed | 362 |
JavaScript Completions | 179 |
Ruby Completions | 49 |
Python Completions | 167 |
Total Stars | 14 |
% of votes with a positive feedback rating | 84% of 91 |
Total "Very Satisfied" Votes | 72 |
Total "Somewhat Satisfied" Votes | 9 |
Total "Not Satisfied" Votes | 10 |