How to store a floating point number as text without losing precision?
floating-point, python
Solution
I'd suggest using the builtin function `repr()`. From the documentation:
repr(object) -> string
Return the canonical string representation of the object. For most object types, eval(repr(object)) == object.
Problem
Like the question says. Converting to / from the (truncated) string representations can affect their precision. But storing them in other formats like pickle makes them unreadable (yes, I want this too). How can I store floating point numbers in text without losing precision?