This project implements functionality to convert a decimal to binary, octal, hexadecimal base. Also, there is a functionality to convert from binary and octal bases to decimal. At the moment, limitations in Sophia language does not allow us to add hexadecimal to decimal converting functionality.
Ensure that you have installed forgAE project
forgae deploy
This command will deploy the contract in the local network.
The configuration of deployment is written in deploy.js
file.
forgae test
All tests should be passing.
dec_to_binary(decimal)
- Performs decimal to binary conversion. Given argumentdecimal
should be represented as an integer. Return type is string.dec_to_oct(decimal)
- Performs decimal to octal conversion. Given argumentdecimal
should be represented as an integer. Return type is string.dec_to_hex(decimal)
- Performs decimal to hexadecimal conversion. Given argumentdecimal
should be represented as an integer. Return type is string.binary_to_dec(binary)
- Performs binary to decimal conversion. Given argumentbinary
should be represented as an integer. Return type is integer.oct_to_dec(oct)
- Performs octal to decimal conversion. Given argumentoct
should be represented as an integer. Return type is integer.