Inspectopedia
 
2024.3

Suspicious underscore in number literal

Warning
New
Last modified: 03 December 2024

Reports decimal number literals that use the underscore numeric separator with groups where the number of digits is not three. Such literals may contain a typo.

This inspection will not warn on literals containing two consecutive underscores. It is also allowed to omit underscores in the fractional part of double and float literals.

Example: int oneMillion = 1_000_0000;