Fixed bug with nums > max integer, changed return type of toDecimal to
long