Fraction as a repeating decimal
Given two integers numerator and denominator (denominator is not 0), return their quotient as a decimal string. When the digits after the point repeat forever, put the repeating block, and only that block, in parentheses: 1/3 is "0.(3)" and 1/6 is "0.1(6)". A whole result has no point ("2"), a finite one ends at its last nonzero digit ("0.25"), and a negative one starts with -; zero is just "0".
The repeating block can be thousands of digits long: aim for time proportional to the digits you write.
Besides the tests, one large input (a 12,010-digit cycle) with a ~220 ms limit (scaled to your device's speed): brute force won't pass.
Examples
to_decimal(1, 4)→"0.25"to_decimal(6, 3)→"2"to_decimal(5, 37)→"0.(135)"to_decimal(1, 6)→"0.1(6)"