Skip to main content

PyClassicRound

The current implementation of round() function in Python 3 uses Banker's rounding i.e integers are rounded to the nearest even integer, this package allows you to round off numbers the classical way.

Installation

PyClassicRound has no dependencies.

> pip install PyClassicRound

Usage (example)

> from PyClassicRound import classic_round

> classic_round(2.55, 1) #outputs 2.6 whereas python 3's round() outputs 2.5

OR

> from PyClassicRound import classic_round as cround

> cround(2.55, 1) #outputs 2.6 whereas python 3's round() outputs 2.5

Parameters

  • Number that needs to be rounded off
  • Upto how many decimal places (optional) (defaults to 2 decimal points (Hundredths Place))

Input parameters can be in any format i.e. integer, float, string etc.

Output will be:

  • integer: if decimal point is 0
  • on successful operation: float
  • None: if the input value cannot be resolved / rounded off for ex. strings -> ("", " ", "abc")

License

MIT

Metadata

Release files for PyClassicRound 2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyClassicRound 2.2
File Size Uploaded
PyClassicRound-2.2.tar.gz 1.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyClassicRound 2.2
File Interpreter ABI Platform
PyClassicRound-2.2-py3-none-any.whl Python 3 none any Details

Total release size: 5.0 kB

Release files / PyClassicRound-2.2.tar.gz

Download URL PyClassicRound-2.2.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
764c55bebe97f08bd2255b08d47c32724ad7d82f8184eea10c04bcd4b7b74570
BLAKE2b-256 checksum
How to use checksums
37c832fcf949b88e15b6fb47e8bc4914cb4da9864818cc58855961413b6cb7a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.4

Release files / PyClassicRound-2.2-py3-none-any.whl

Download URL PyClassicRound-2.2-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
663c7d76d4e15b519735b16943dfc6a15e5b7953ac86d98ae893b0f5594e0891
BLAKE2b-256 checksum
How to use checksums
8eb1dcf15f03c207abbf2bedaabea1181449b2c1f0ab7855a67d155bafa0873e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.4

Release history Release notifications | RSS feed

This release

2.2 This release

2 release files

2.1

2 release files

2.0

2 release files

1.6

2 release files

1.5

2 release files

1.2

2 release files

1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page