Decimal conversion working

Code now determines the bit length based on a set of rules. See line 131
- 139 for more detail.