You don't need to don't specify `%6N` or `%9N` but just `%N` instead it will go out to 9 digits by default (on my system). Depending on the platform this may or may not ever have digits there.

While not a huge deal it would simplify the conditional a bit.

On 1.8.7 you can also get more digits out of a Time object by using `#to_f` by doing something like `"%.9f" % Time.now.to_f"`. Granted, this will probably be susceptible to standard float precision.