7 kyu
Float Precision
3,180 of 6,160jhoffner
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
A lot of 8th kuy katas, that requires rounding to 2 decimal as a part of a task: exists
7th kuy kata: please do nothing, just round a value.
python new test frame work
Approved
There are (still) no test cases in the Ruby translation. Since this is a beginner problem, it would be a good idea to have them.
Already raised as issue, you can add them by forking the translation and ask for approval in Discord!
COBOL translation.
Approved
C translation
Approved :)
No sample tests in ruby
No random tests in ruby
Ruby uses
Test.expect
Ruby 3.0 should be enabled (Refer this & this for more detail)
fixed
10 kyu....
initial test case confused me
R translation added. Please review :).
It's far too easy for 7kyu
This is probably an old kata, so take the easy points.
Oh, that's 7kyu? No-no, only 9kuy)
Javascript https://www.codewars.com/kumite/5b7e3f187a0c9d2e780000cd?sel=5b7e3f187a0c9d2e780000cd
Haskell : https://www.codewars.com/kumite/5b7b7bf8cb5688747f00026e?sel=5b7b7bf8cb5688747f00026e
Hi, the Python translation is still waiting for approval :) Thanks, suic
.
Python translation kumited
This comment has been hidden.
Your current solution prints the number to the screen and returns void. Instead, your function should return the rounded number.
This comment has been hidden.
I had the same problem. I had correct code that failed the tests. Unlocked solutions to discover the code was accurate. Annoyed that I couldn't get kata for this when the solution was correct. Got the same feedback "test didn't pass unknown error".
"Unknown error" usually means that you've tried a test with no test cases (e.g. run example test cases, but they're empty), or that there is some kind of internal error. Unless there is a concrete error message like "value wasn't expected" or "values differ", interpret this as some internal issue. Try again later and, if it still doesn't work, file a bug report.
What does "closest precision of two" mean?
Nothing wrong with the test, but 'Precision' is spelt wrong in the title ('Float Precesion')
Wow. This kata went a long time without anyone picking up on that - until now. Thanks!
And that's a hell of a response time, you're welcome!
When using round(2) on an int, you're only getting a precision of 1 and your tests don't include any integers when they're specified in the question[requirement]. I expected all int and floats to return x.00 values and made my solution behave that way.
Maybe it's just my interpretation of "closest precision of two" but an example with an int showing the output you want would help to clear that up.
Thanks Mitchell. This was just intended to be a simple exercise. I've changed the description so that it indicates that the number passed in is always a float.
Thanks. Just wanted to make sure people didn't go down the wrong path.
Sent.
Got it. Try it now.
Yep, now it returns a useful error message saying it was returning a string instead of a float. Thanks!
Test::Error: Expected solution(2.3445345) to give 2.34, instead got 2.34
Looks right to me...
I am wondering about the same
This is a very weird bug. Can you send your solution to me at jake@codewars.com? Thanks.
The output message wasn't distinguishing between strings and floats. It does now.