add helper functions isNegative, truncateDecimal and isANumberCheck