Fix for number precision when writing floats.

Fix for issue #9 with test.