Ad
  • Custom User Avatar

    Clearly, there are some big issues with the kata.

    1. Input: 60555138471.215004
      Expected: 'sixty billion five hundred and fifty-five million one hundred and thirty-eight thousand four hundred and seventy-one point two one five zero ', instead got: 'sixty billion five hundred and fifty-five million one hundred and thirty-eight thousand four hundred and seventy-one point two one five'
      Why is there an extra space in the end of expected result.

    2. Input: 7868187285.488895
      Expected: 'seven billion eight hundred and sixty-eight million one hundred and eighty-seven thousand two hundred and eighty-five point four eight eight eight zeronine five', instead got: 'seven billion eight hundred and sixty-eight million one hundred and eighty-seven thousand two hundred and eighty-five point four eight eight nine'
      What is zeronine???

    3. Input: 38455676677.275635
      Expected: 'thirty-eight billion four hundred and fifty-five million six hundred and seventy-six thousand six hundred and seventy-seven point two seven five six four', instead got: 'thirty-eight billion four hundred and fifty-five million six hundred and seventy-six thousand six hundred and seventy-seven point two seven five six three'
      There's no mention about how to handle the floating point digits. Whether to just cut it, round it, or do something else with it.

  • Default User Avatar

    sometimes there is extra zero with space in the end ('00' should be or 'zero zero' or '', but not 'zero ')

    -32744575524.326004 -> negative thirty-two billion seven hundred and forty-four million five hundred and seventy-five thousand five hundred and twenty-four point three two six zero - Expected: 'negative thirty-two billion seven hundred and forty-four million five hundred and seventy-five thousand five hundred and twenty-four point three two six zero ', instead got: 'negative thirty-two billion seven hundred and forty-four million five hundred and seventy-five thousand five hundred and twenty-four point three two six'

    sometimes there is a zeronine (which is result of rounding up 9 as I sould see)

    26956648968.618298 -> twenty-six billion nine hundred and fifty-six million six hundred and forty-eight thousand nine hundred and sixty-eight point six one eight two zeronine eight - Expected: 'twenty-six billion nine hundred and fifty-six million six hundred and forty-eight thousand nine hundred and sixty-eight point six one eight two zeronine eight', instead got: 'twenty-six billion nine hundred and fifty-six million six hundred and forty-eight thousand nine hundred and sixty-eight point six one eight three'

    I'm not sure how I could reproduce such a logic. finally I wrote a workaroung for zeroes and spaces and pressed attempt until got random tests without 'zeronine' issue.

    As a fix I'd suggest to throw away rounding and '5 decimal places' condition. Another way is to choose some rounding method and state that in description as there are more than one way to do that (for example in JS (0.651365 + Number.EPSILON).toFixed(5) > (0.651365).toFixed(5) )

  • Default User Avatar

    I am agree with you, there is a mistake in decimal numbers with something like "zeronine" in expecting results.
    Also i saw failed tests with :

    Expected: '...eight hundred and sixty-seven point five zero eight two ',
    insted got: '...eight hundred and sixty-seven point five zero eight two'

    Simple ' ' in the end, wtf is this?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Yeah, the description isn't clear (I didn't write it). I guess it should be changed to 5 specifically.

  • Custom User Avatar

    the description is ambiguous:

    Support at least 5 decimal places.

    1. why? => that limit could be suppressed
    2. currently, it's not "at least", it's "at most", without specifying a rounding.
  • Custom User Avatar

    Possible I missed some edge cases. Regardless, your solution had numerous issues (including failing to round up from x.xxxx5), which is likely why it took you 100+ attempts.

  • Custom User Avatar

    I managed to submit my 100th attempt. I tried some other solutions, they are all failing now. Anyway, I'm done with this. This was a horrible experience.

  • Custom User Avatar

    you expect the digit zeronine ?

    -1105915342.5357988 -> negative one billion one hundred and five million nine hundred and fifteen thousand three hundred and forty-two point five three five seven zeronine eight eight - Expected: 'negative one billion one hundred and five million nine hundred and fifteen thousand three hundred and forty-two point five three five seven zeronine eight eight', instead got: 'negative one billion one hundred and five million nine hundred and fifteen thousand three hundred and forty-two point five three five eight'
    
  • Custom User Avatar

    I'm sure you could have found a more constructive way to phrase that, but updated.

    As it happens, it looks like I didn't so much "make a mess", as the original JS solution had issues which were exposed by the additional tests-- something I didn't realize as my solution passed against the reference when I tried it.

    Your solution, by the way, has a few issues with it.

  • Custom User Avatar
  • Custom User Avatar

    Random tests are incorrect for decimal numbers. Please expect 5 decimal places at most.

  • Custom User Avatar
  • Default User Avatar

    I'm having the same issue. Only case that doesn't work is the main test for NaN. Strings that evaluate to numbers work. How can I fix this??
    EDIT - figured it out! Phew, sorry for the panic :P. Had fun on this one!

  • Custom User Avatar

    Hi, Thanks for responding.

    Yep, turns out i was checking for NaN incorrectly. Was getting confused why strings were not appropriate for raising an error, but I see now that the kata description says "non-numbers - Strings that evaluate to numbers should be converted to numbers. NaN values must throw an error. "

    Thanks for the tip about the tests - that got me unstuck.

  • Loading more items...