# Question about the determinant of an upper triangular matrix

I was watching an online lecture on the properties of determinants and at 27:00 in this lecture: https://www.youtube.com/watch?v=srxexLishgY&t=4s, the professor did a step which I don't understand.

If $$A = \begin{pmatrix}d1 & 0 & 0\\ 0 & d2 & 0\\ 0 & 0 & d3\end{pmatrix}$$, then according to the lecturer, $$A=d1 *d2 *d3 \begin{pmatrix}1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1\end{pmatrix}$$, this was then used to show that the determinant of an upper triangular matrix can be written as the product of the leading diagonal . However I thought if a matrix is multiplied by a number, all elements of the matrix are multiplied by it. Is this just wrong?