I'm using Visual Studio 2008 and I have just noticed that the debugger is displaying integer values as Hex when I hover over variables and also in the immediate window. I guess I must have hit a shortcut key accidently or something.
Anyone had this before? How do I set it back to display in decimal?
In the immediate window you can uncheck the Hexadecimal Display option.
Right-click on client space of almost every debug window (except Immediate Window) - watch/locals/autos/threads/call stack - and uncheck "Hexadecimal Display" option. There's also a "Hex" button in debug toolbar (right to "Step Over" by default) when debugging.
In Visual Studio 2010 I also saw it in the Debug toolbar, it was highlighted in yellow 'Hex', I just clicked it and it returned to (normal) decimal values
Right-click your Watch Window or Immediate Window and uncheck Hexadecimal Display option.
There is a Hex button shown when Visual Studio is run in Debug mode to enable/disable the Hex display
You can also choose hexadecimal or decimal display on a per-variable basis in the Visual Studio watch window by appending a debugger format specifier to the variable name. In the watch window, enter:
The other very useful format specifiers are
ac
(see footnote) for 'always calculate', andnq
for displaying with 'no quotes.' They can be used together:nq
is useful insideDebuggerDisplay
attributes, which can appear on a class:...or on one or more field(s) inside a class:
http://msdn.microsoft.com/en-us/library/e514eeby(v=VS.100).aspx