Allow floats as duration

Another shot at https://github.com/gumroad/countdown.js/issues/4. This is extracted from this PR (https://github.com/gumroad/countdown.js/pull/7) and converts the duration instead as @kn had suggested.