Maybe you can build a logic like, lets say your value is
N = 12.0000008000
You can find no. Of significant digits after decimal
Use N-floor(N) =. 0000008000
Divide this number by 1, 1/.0000008000=1250000
Use log of this number, which returns 6.09, use ceil (6.09) which returns 7
Use this in the repeat function.
Hence your expression looks like
Num(N,'#.'&repeat ('#', ceil(log (1/(N-floor(N) )))))
THIS should work.
I couldnt try this out, sorry as I am travelling but something like this would definitely work for you.
Please check the expression before you use.