Skip to main content

A module to represent numbers by their place value.

Project description

https://travis-ci.org/necessary129/NumRep.svg

Version: 0.0.2

This module provides a way to represent the place values in a given number, eg:
>>> a = NumRep(1234456789123)
>>> a
NumRep(Crores=123445,Lakhs=67,Thousands=89,Hundreds=1,Tens=2,Ones=3)
>>> a.crores
123445
>>> a.ones
3
>>> a.hundreds
1
>>> a.tens
2
>>> a.lakhs
67
And Every integer in the NumRep has a GetRep() method, which returns the Representation of the number itself, eg:
>>> a = NumRep(123456789)
>>> a
NumRep(Crores=12,Lakhs=34,Thousands=56,Hundreds=7,Tens=8,Ones=9)
>>> a.crores
12
>>> a.crores.GetRep()
NumRep(Tens=1,Ones=2)
>>> a.crores.GetRep().tens.GetRep()
NumRep(Ones=1)
You can also do arithmetic operations on them and then use GetRep(), eg:
>>> a = NumRep(123456789)
>>> a
NumRep(Crores=12,Lakhs=34,Thousands=56,Hundreds=7,Tens=8,Ones=9)
>>> (a.crores - 2).GetRep()
NumRep(Tens=1)
This raises TypeError when you give a non-number to it., eg:
>>> a = NumRep('notanumber123')
Traceback (most recent call last):
...
TypeError: Not a valid number
This class also provides an all() function, which gives you the real value of the given denomination, eg:
>>> a = NumRep(1234456789123)
>>> a.all('hundreds')
12344567891
You can also use the values specified in the module for all(), eg:
>>> a.all(CRORES)
123445

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

NumRep-0.0.1.zip (6.1 kB view details)

Uploaded Source

NumRep-0.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distributions

NumRep-0.0.1.win-amd64.exe (227.9 kB view details)

Uploaded Source

NumRep-0.0.1.linux-x86_64.tar.gz (5.0 kB view details)

Uploaded Source

NumRep-0.0.1-1.src.rpm (7.9 kB view details)

Uploaded Source

NumRep-0.0.1-1.noarch.rpm (8.9 kB view details)

Uploaded Source

File details

Details for the file NumRep-0.0.1.zip.

File metadata

  • Download URL: NumRep-0.0.1.zip
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for NumRep-0.0.1.zip
Algorithm Hash digest
SHA256 be4563364b0b6d817d3202d2d6e94ef1fd17411f9814b379da662a7289d69109
MD5 03f8c246f28e48a2ddbf21b960317110
BLAKE2b-256 e992a12799b8e40d2e6931e011732a1892f02da79409b492ac3225eb8e7563fa

See more details on using hashes here.

File details

Details for the file NumRep-0.0.1.tar.gz.

File metadata

  • Download URL: NumRep-0.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for NumRep-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d0515903bb96dff653007cbdf6b212fc8a472fec3673cbcd9aa9425542299024
MD5 158edc08b5f6f0bfebebbd482ff0881d
BLAKE2b-256 bcc1aabdbc7815a5c99199abe8e387b6de3a9f886d9b449545aa4987072dd613

See more details on using hashes here.

File details

Details for the file NumRep-0.0.1.win-amd64.exe.

File metadata

File hashes

Hashes for NumRep-0.0.1.win-amd64.exe
Algorithm Hash digest
SHA256 a3cd46ee3b1f0de383c7825a82b1bb2536e149aed3fb5dc0196b1cd75e4508ac
MD5 a534b0f5f34916f24bd002e38592857f
BLAKE2b-256 9ab17c115cd68f70c05831a8797679bdef7f4e81982f3710cbbb41af54f0b2bd

See more details on using hashes here.

File details

Details for the file NumRep-0.0.1.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for NumRep-0.0.1.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 2662c79b4dce6dfc8be0aa070786e5713649358658cdb01f8c2314f35956aa35
MD5 1cecc3cca5132d3f212146c67c30a3d7
BLAKE2b-256 1ecaa3d4e164cf601dcccbf571883553ee76a98a4f4f49d88bc59c30afc1a25c

See more details on using hashes here.

File details

Details for the file NumRep-0.0.1-1.src.rpm.

File metadata

  • Download URL: NumRep-0.0.1-1.src.rpm
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for NumRep-0.0.1-1.src.rpm
Algorithm Hash digest
SHA256 5d44f5ea8952705419ba9922d66ad506688ff620153e048bc4dd553a23ed3340
MD5 ccb78ef5b4e348e348ceb84c5958c938
BLAKE2b-256 7101769ddad5d528fa8f3413dec8fd0c6f082ca725b049977291acb0d3552b83

See more details on using hashes here.

File details

Details for the file NumRep-0.0.1-1.noarch.rpm.

File metadata

File hashes

Hashes for NumRep-0.0.1-1.noarch.rpm
Algorithm Hash digest
SHA256 f0ffced2f68ba9e65fac932bce0ca9528b4483d0186372ea7efbf82ed56e4e90
MD5 f40668b356dda87c989350d46f103b66
BLAKE2b-256 031bf3e7ddfce14d0e332b38430843789a972657f42cbba1232c15e631bb8dde

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page