Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Needs lots of other decimals with varying number of significant digits.
And 1 random test cases is far from enough. Not to mention that you pass
-2
as the second parameter, basically nullifying whatever random tests are supposed to do.Except you have string inputs. Strings are not numbers.
Also,
roundAndPad(-1.1232,19) == "-1.1232000000000000000"
does not make much sense because double precision floats doesn't have 19 digits of precision anyway, so if you're rounding it to 19 decimal places you'll get stuff like-1.1231999999999999762
.Taking types into consideration, this is not true. The test suite still expects a string when
d
is negative, rather than the numbern
itself.