embedded a portion of double-conversion library (http://code.google.com/p/double-conversion/)and replaced stream-based number formatting