7 kyu

Frugal Pizza

351 of 419saifahn
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ejini战神 Avatar

    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 requirement confusion to the task...

  • ejini战神 Avatar

    Description should be language-agnostic

  • ejini战神 Avatar
    • Node 18 should be enabled (Refer this and this for more info)
  • hobovsky Avatar

    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.

  • leesc22 Avatar

    Ruby translation. Please check and approve =)

  • Souzooka Avatar

    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)?

  • fangs073 Avatar

    The description should explicitly state that the price should be rounded, rather than truncated.

  • donaldsebleung Avatar

    If you are given too few arguments, or if they aren't numbers, then return 0.

    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.

  • kevinsmithwebdev Avatar

    Are you kidding me? The day I publish my first kata, you "coincidentally" publish almost the exact same thing? [rolls eyes]

  • tachyonlabs Avatar

    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:

    ✘ Expected: '0.11173326617063674', instead got: '0.11' 
    
    • saifahn Avatar

      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".