In Roman numerals, the number four is written as "IV". However, you are correct that on some traditional Roman sundials and clocks, the numeral for four was sometimes written as "IIII". This is a historical peculiarity rather than the standard form.
The reason behind this deviation is not entirely clear but could be due to a few factors:
However, in modern usage and formal contexts, "IV" is the correct and accepted representation of the number four in Roman numerals. The "IIII" variant is generally considered an exception or an error outside of specific historical contexts related to clocks and sundials.