Convert roman numeral to number and manage roman number object
Project description
Roman numerals
Manage roman numerals using roman number object.
Convert roman numeral to integers
roman
function
return roman numeral string
import roman_numbers as r
x = 10
print(r.roman(x))
Output:
>> X
roman(number:int, extend=1)
extended function
return roman numeral string
import roman_numbers as r
x = 7580
print(r.roman(x, extend=1))
Output:
>> V̅MMDLXXX
number
function
return integers from roman numeral
import roman_numbers as r
x = 'X'
print(r.number(x))
Output:
>> 10
rom
object
support Basic and Compare opeartion for roman numeral
from roman_numbers import rom
>> rom(10) + rom(10) # add
>> XX
>> rom(5) - rom(1) # sub
>> IV
>> rom(5) * 3 # mul
>> XV
>> rom('V') > rom('XI') # compare
>> False
>> rom('V') == 5 # compare
>> True
>> int(rom('XI'))
>> 11
Version
1.0.1 - Release 1.0.2 - Add description and minor fix
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
roman_numbers-1.0.2.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for roman_numbers-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffbc00aaf41538208f975d1b1ccfe80372bae1866e7cd632862d8c6b45edf447 |
|
MD5 | f2985ace8c4baec74aa7cb5fad642e15 |
|
BLAKE2b-256 | 9a8509e9e6bd6cd4cc0ed463d2b6ce3c7741698d45ca157318730a1346df4819 |