How to safely and reasonably convert a float or double to string or char array?