Thanks to Zappedagain and Cummings54.
This is very close. In fact cumming54's function works well for all numbers except it doesn't identify trailing zeros as significant.
For example, if I have a dimension 1.000 it indicates accuracy out to the third decimal place, so the zeros are...