Attach ke- to a number and you have the ordinal. That is the whole rule.
kedua ‘second’
ketiga ‘third’
keempat ‘fourth’
kesepuluh ‘tenth’
The one exception
Pertama ‘first’. Not kesatu.
Kesatu exists and appears in lists and official numbering, but for ordinary use it is pertama. This is the only irregular ordinal in the language, which after English is a relief.
Last
terakhir ‘last’, built on akhir ‘end’.
Terakhir kali. ‘The last time.’
Note the ter- prefix doing its superlative job from the affixes chapter.
Where you will need them
Lantai kedua. ‘Second floor.’
Untuk pertama kali. ‘For the first time.’
Gang ketiga. ‘The third alley.’
That last one comes up constantly when giving directions in a kampung, where roads are numbered rather than named.
Ground floor
Indonesia counts like the United States, not like Europe. Lantai satu is the ground floor and lantai dua is one flight up.
A European reading lantai dua as the second floor will climb one storey too many, which matters mainly when you are carrying something.
Dates use cardinals, not ordinals
tanggal tujuh belas ‘the seventeenth’
No ke-, no ordinal. Indonesian says “date seventeen”, which is one fewer thing to learn than in English or French.
Ke- doing its other job
You met ke as the place word meaning ‘to’, and ke-…-an wrapping words to make abstract nouns. Same syllable, three different jobs, and only position tells you which. Attached to a bare number, it is always an ordinal.