S
S
Senseich2018-03-18 01:52:30
C++ / C#
Senseich, 2018-03-18 01:52:30

What does the number after the decimal point mean when interpolating in C#?

I'm going to break down simple examples. Got this example:

double[] array2 = new double[5] { 1.2, 3.4, 5.6, 7.8, 9.10 };

            foreach ( double element in array2 )
            {
                Console.WriteLine($"{element,5}^2 = {element * element}");
            }

I can't understand what is 5 after the decimal point in the loop? {element,5}
I tried to remove the semicolon, it still works)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question