Support formatting really small numbers

When formatting numbers like 0.00000001, result is always truncated to an integer, when pattern is not precise enough. Included test cases demonstrates this.

This is because small numbers are converted to scientific notation by `str(x)` and splitting them by decimal point separator (`'.'`) will not work.