This is a little hard to read:
int x = 100000000;
Is there an easy way to write:
int x = 100,000,000;
So that the scale is obvious?
Please note this is NOT about formatting the output.
Starting with C#7 you will be able to use the underscore-char (_
) to seperate digit groups. The underscore can be placed anywhere in a number. A simple example:
const int MILLION = 1_000_000;
You can place the _
anywhere you want and can even combine it with integer literals:
const int USHORT_MAX = 0xFF_FF;
Or even with floats and decimals, even after the decimal sign:
const decimal SMALL_VALUE = 0.000_000_001;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With