fix write double and floats