Changed sprintf to snprintf in MemoryOutStream::FormatToStream.

Removed trailing 'f' from floats and formatted all floats and doubles to '%0.6f'.