Retired

Retrieving Small Precision Decimal (retired)

Description:

Someone has mixed all my data and i need your help to reorganize them !

You will be given a number which can be either integer (1), float (1.23) or string representation of a float ("77.7") or integer ("42").

Your job is to return a float with the first 2 decimals of the argument given (n) as a string if it doesn't have a decimal part, then return None.

If the given argument have more than 2 decimals digits, make sure it is follows these 2 rules:

  • if the 3rd decimal digit is below 5, it should be round down
  • if the 3rd decimal digit is 5 are above, it should be round up

We want only the 2 decimals, do not return anything above 1

Let's keep it easy Do not return the original argument type, return every argument as either float or None (according to the rule explained above)

Since we care only of decimal, you should return a value always between 0 and 1.

Fundamentals

More By Author:

Check out these other kata created by Sigmanificient

Stats:

CreatedJun 20, 2021
Warriors Trained12
Total Skips0
Total Code Submissions31
Total Times Completed6
Python Completions6
Total Stars0
% of votes with a positive feedback rating0% of 5
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes0
Total "Not Satisfied" Votes5
Total Rank Assessments4
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Sigmanificient Avatar
Ad