From the evolution of the glyph section of the Wikipedia entry for '7':
As is the case with the European glyph, the Cham and Khmer glyph for 7
also evolved to look like their glyph for 1, though in a different
way, so they were also concerned with making their 7 more different.
For the Khmer this often involved adding a horizontal line above the
glyph. This is analogous to the horizontal stroke through the
middle that is sometimes used in handwriting in the Western world but
which is almost never used in computer fonts.
It goes on to say this regarding usage of the horizontal line:
Most people in Continental Europe, Latin America, and New
England write 7 with a line in the middle ("7"),
sometimes with the top line crooked. The line through the middle is
useful to clearly differentiate the character from the number one, as
these can appear similar when written in certain styles of
handwriting. This glyph is used in official handwriting rules for
primary school in Russia, Ukraine, Romania and other Slavic