format: Check for NaN when rendering doubles