Oh, The Numeral... that bastard.. my grammar teacher told me that The Numeral is the most difficult part of our native language .. it is true.. I usually have to use grammar book to write them correct.. shame on me.. well
1) if the last part of the numeral is -сотий, -тисячний, -мільйонний you should write them as one word.
For example: дев’ятисотий, п’ятнадцятий, п’ятсоттридцятитисячний, шістдесятий, шістдесятип’ятимільйонний; багатотисячний, кількамільйонний.
125 000 000-ий - стодвадцятип'ятимільйонний
2) Other complex numerals you should write separatly and only the last word(part) of it will be in genitive case
For example: тисяча дев’ятсот дев’яносто перший
600 001-ий - шістсот тисяч перший
583 992-ий - п'ятсот вісімдесят три тисячі дев'ятсот дев'яносто другий