6 kyu

Round by 0.5 steps

1,957 of 4,835vshjxyz

Description:

Round any given number to the closest 0.5 step

I.E.

solution(4.2) = 4
solution(4.3) = 4.5
solution(4.6) = 4.5
solution(4.8) = 5

Round up if number is as close to previous and next 0.5 steps.

solution(4.75) == 5
Mathematics
Fundamentals

More By Author:

Check out these other kata created by vshjxyz

Stats:

CreatedJul 25, 2013
PublishedJul 26, 2013
Warriors Trained7459
Total Skips825
Total Code Submissions21311
Total Times Completed4835
CoffeeScript Completions206
JavaScript Completions1714
Python Completions1957
C# Completions521
Rust Completions538
COBOL Completions10
C Completions39
Total Stars102
% of votes with a positive feedback rating91% of 751
Total "Very Satisfied" Votes636
Total "Somewhat Satisfied" Votes100
Total "Not Satisfied" Votes15
Ad
Contributors
  • vshjxyz Avatar
  • jhoffner Avatar
  • ZozoFouchtra Avatar
  • GiacomoSorbi Avatar
  • kazk Avatar
  • JohanWiltink Avatar
  • LesnyRumcajs Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • akar-0 Avatar
Ad