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.
If you are given too few arguments, or if they aren't numbers, then return 0. In C# you will be given only numbers.
Then the parameter should be given as a list, also there is no specification in example and sample tests on how to handle this, so it is extra
requirementconfusion to the task...This is an issue, since the requirements do not match with other language(s?) (JS only for now)
Description should be language-agnostic
I don't like how example tests (for C# at least) do not contain cases for missing parameters. "If you are given too few arguments [...]" can be interpreted in a few ways, and it's somewhat puzzling when you get compilation errors on final tests.
Ruby translation. Please check and approve =)
Hi, I have a C# translation Kumited. However, I am a bit confused on how exactly you want the result to be rounded.
Do you want the result to be rounded (e.g. 0.02123 -> 0.02, 0.100321 -> 0.1) or truncated (e.g. 0.108231 -> 0.10)?
The description should explicitly state that the price should be rounded, rather than truncated.
Fixed.
In your random tests, the input you pass into the user function are all numerical strings and not actual numbers but they expect nonzero return values.
Are you kidding me? The day I publish my first kata, you "coincidentally" publish almost the exact same thing? [rolls eyes]
Thanks! I've updated it. I think I had the same problem with the actual test cases too.
I've also updated the description to say "to two decimal places".
In your example tests you've got the actual and expected parameters reversed -- see https://www.codewars.com/docs/js-slash-coffeescript-test-reference -- which makes error messages look confusing, like this:
And please add at least 3 more fixed assertions before you even begin adding random tests - only 2 fixed assertions in the entire test suite is unacceptable.
Loading more items...