Added safe-convert function

Added `safe-convert` function that may sometime help prevent browser
rounding errors