Safe rounding for javascript, useful in financial calculations