Q:

Get precision of any decimal number

(Sorry for the inconvenience related to the tags, please feel free to correct my post if it needs a better scope by adding some other tags).
CONTEXT
I have several (decimal) numbers shaped like this :

1.081
289.089167
2.98
...

PROBLEM
I would like to get a decimal number, that I call "precision", which would give me the precision, which means the number of digits of this (decimal) number.
EXPECTED RESULTS

1.081 => 0.001
289.089167 => 0.000001
2.98 => 0.01
67.00...n  => 0.0...(n-1)..1

ATEMPTS
I work in IT, and most precisely on an audio apps. So I have a audio file in input, and it gives me the audio duration.
What I try to achieve is to set a range, which you can find in any other website shaped like following :
<input type="range" value="0" min="0" max="???" />

And initated to 0. The user can drag the cursor to change the currentTime of the audio, and to be the most precise possible, I have to get the precision, in order to set the "max='???'" like following :
max="getPrecision(audio.duration)"

I simplifyed the code, in reality the max property will be changed via JavaScript but it is not the aim of my question.
QUESTION
Does a mathematical formula exists to get this expected output ?

A:

Given that your input number is "$\color\red{n}.\color\green{m}$", the formula is "$\color\red{n}.\color\green{m}$"/"$\color\red{n}\color\green{m}$".
So in any scripting language, simply divide the rational number represented in the original string, by the integer number represented in the original string without the decimal point.

