The name should be entered as they were originally named/baptised/registered.
Any name used other than a given name can be entered as an "also known as".
The example you give e.g. William IV is a regnal numbers and do not form any part of a name - you could use the "Title fact" for those if required.