New significant digit helper

Abstracted out some of the code needed to determine how many significant digits
to round a number to and put it in a new helper.