Formula field result format not consistent
I have 3 formula fields. The formula is basically this:
(((Date1 - Date2) / 86400000)).toLong()
I had one field like that in my application for months. In report it is shown as number.
Today I wanted to add now formula field:
(((Date3 - Date2) / 86400000)).toLong()
That shows up now in the report as text (the values are calculated correctly)
What is misterious is that if I make another formula field (3rd) and copy the formula from the first one
(((Date1 - Date2) / 86400000)).toLong()
That too now is shown as text format, not number.
What is going on here?