如何在Android Studio(含3.x版本)调试时禁用科学计数法?
Hey there! I totally get how frustrating those tiny scientific notation numbers are when debugging—they turn straightforward values into something that’s way harder to parse at a glance. Let’s fix that right away, whether you’re on Android Studio 3.x or a newer version.
Method 1: Use the IDE Settings UI
This is the most straightforward way for most users:
- Open Android Studio, then go to
File→Settings(Windows/Linux) orAndroid Studio→Preferences(Mac). - In the settings window, navigate to
Build, Execution, Deployment→Debugger→Data Views→Java. - Look for the option labeled "Use scientific notation for numbers" and uncheck the box next to it.
- Hit
ApplythenOK, and restart Android Studio to make sure the changes take effect.
Method 2: Edit the idea.properties File (For Trickier 3.x Versions)
If you can’t find the UI option in your Android Studio 3.x build, editing the config file directly works too:
- Locate the
idea.propertiesfile for your Android Studio 3.x installation:- Windows:
C:\Users\<Your Username>\.AndroidStudio3.x\config\idea.properties - Mac:
~/Library/Preferences/AndroidStudio3.x/idea.properties - Linux:
~/.AndroidStudio3.x/config/idea.properties
- Windows:
- Open the file with a text editor, then add or modify this line:
debugger.display.numeric.scientific.notation=false - Save the file, restart Android Studio, and you’re good to go.
Once you’ve done either of these steps, next time you debug your app, numeric values in the debugger’s variable panel will show up as regular decimal numbers (like 123456 instead of 1.23456E5)—no more squinting at those annoying exponents!
内容的提问来源于stack exchange,提问作者c0dehunter

