This script converts decimal numbers to Cyrillic numerals. It includes an option to add a titlo symbol to the result.
- Convert decimal numbers to Cyrillic numerals
- Optional titlo symbol addition
- Command-line interface
- Can be used as a Python module
- Python 3.x
- Bash
- Clone this repository:
git clone https://github.com/slojinika/dec2cyrs.git
- Navigate to the project directory:
cd dec2cyrs
Run the script from the command line:
python dec2cyrs.py [-h] [-t] number
Arguments:
- number: The decimal number to convert (required)
- -t, --titlo: Add titlo to the result (optional)
- -h, --help: Show help message and exit
from dec2cyrs import dec2cyrs
# Convert 888 to Cyrillic
result = dec2cyrs(888)
print(result)
# Convert 888 with titlo
result_with_titlo = dec2cyrs(888, use_titlo=True)
print(result_with_titlo)
- Convert 888 to Cyrillic:
python dec2cyrs.py 888
- Convert 888 with titlo:
python dec2cyrs.py -t 888
- Implement input validation in the Bash script to prevent users from entering invalid numbers. 1.1. Sub-tasks:
- Check if the input is -1.
- Check if the input exceeds the specified range (e.g., maximum allowed value).
- Provide appropriate error messages if invalid input is detected.
- The titlo in the thousands is being placed incorrectly. We need to make it so that the ҂ is ignored.