diff --git a/Charts/Core/vtkAxis.cxx b/Charts/Core/vtkAxis.cxx
index 98200a932923be965066dd0f45f956bc8f8a251e..5fcfc1df77ebc59ea8a7b395005902c93b82e979 100644
--- a/Charts/Core/vtkAxis.cxx
+++ b/Charts/Core/vtkAxis.cxx
@@ -1197,7 +1197,7 @@ vtkStdString vtkAxis::GenerateSimpleLabel(double val)
     // On Windows, formats with exponents have three digits by default
     // whereas on other systems, exponents have two digits. Set to two
     // digits on Windows for consistent behavior.
-#ifdef _WIN32
+#if defined(_MSC_VER) && _MSC_VER < 1900
     unsigned int oldWin32ExponentFormat = _set_output_format(_TWO_DIGIT_EXPONENT);
 #endif
 
@@ -1207,7 +1207,7 @@ vtkStdString vtkAxis::GenerateSimpleLabel(double val)
       len = buffSize;
       }
 
-#ifdef _WIN32
+#if defined(_MSC_VER) && _MSC_VER < 1900
   _set_output_format(oldWin32ExponentFormat);
 #endif