Improve significant figures logic
Merge pull request #303 from FrontierOtr/significant-digits

Improve significant figures logic