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.
'Fixed, see comments above'
Issue not specified.
Also, toFixed() gives bad behaviour sometimes; best practice to round x to the y decimal digit is to use
Math.round(x*Math.power(10,y))/Math.power(10,y)
.In this case
Math.round(x*100)/100
should cut it.You're returning a String, while you're expected to return a Number.
I think you meant to say that a solution with
String.prototype.replace
is accepted.Thanks for reporting, it is fixed. :)
Sorry I didn't get you. Could you be more specific?
The first thing I would recommend doing is taking a step back and evaluating you're approach to validating the inputs. Currently you're doing a lot of checks to verify that number is NOT a lot of things, when you could simplify your approach by verifying that number is in fact the type of number you expect it to be (research Ruby's numerical data types to determine which type to check for). That should allow you to clean up some of your logic a bit. As for passing the final test, I would recommend checking what value is being passed in, by logging it to the console somehow. :)