global number field & text entered in it

I have a layout with a global number field. If I enter a number & then some non numeric texts, it shows the text in the field but if I check the value through a dialog or application.output the field retains previously entered number field.

It is logical that a number field must hold a number value. But it allows user to enter text value.
I feel this is confusing. Is this expected or a bug?

I would say the global number field should prohibit allowing non-numeric values