kyu_7.formatting_decimal_places_1 package

Submodules

kyu_7.formatting_decimal_places_1.test_two_decimal_places module

Solution for -> Formatting decimal places #1.

Created by Egor Kostan. GitHub: https://github.com/ikostan

class kyu_7.formatting_decimal_places_1.test_two_decimal_places.TwoDecimalPlacesTestCase(methodName='runTest')[source]

Bases: TestCase

Testing two_decimal_places function.

_classSetupFailed = False
_class_cleanups = []
test_two_decimal_places = None
test_two_decimal_places_0(**kw)

Testing two_decimal_places function with various test inputs [with number=10.1289767789, expected=10.12, msg=”didn’t work for 10.1289767789”].

Each floating-point number should be formatted that only the first two decimal places are returned.

You don’t need to check whether the input is a valid number because only valid numbers are used in the tests.

Don’t round the numbers! Just cut them after two decimal places! :return:

test_two_decimal_places_1(**kw)

Testing two_decimal_places function with various test inputs [with number=-7488.83485834983, expected=-7488.83, msg=”didn’t work for -7488.83485834983”].

Each floating-point number should be formatted that only the first two decimal places are returned.

You don’t need to check whether the input is a valid number because only valid numbers are used in the tests.

Don’t round the numbers! Just cut them after two decimal places! :return:

test_two_decimal_places_2(**kw)

Testing two_decimal_places function with various test inputs [with number=4.653725356, expected=4.65, msg=”didn’t work for 4.653725356”].

Each floating-point number should be formatted that only the first two decimal places are returned.

You don’t need to check whether the input is a valid number because only valid numbers are used in the tests.

Don’t round the numbers! Just cut them after two decimal places! :return:

kyu_7.formatting_decimal_places_1.two_decimal_places module

Test for -> Formatting decimal places #1.

Created by Egor Kostan. GitHub: https://github.com/ikostan

kyu_7.formatting_decimal_places_1.two_decimal_places.two_decimal_places(number) float[source]

Format decimal places #1.

Each floating-point number should be formatted that only the first two decimal places are returned. :param number: :return: float

Module contents

Formatting decimal places #1.