When were numeric contractions for ordinals first used, as in 1st, 2nd, 3rd, 6th instead of first, second, third, sixth? When we use words like first, second, third, fourth or 1st, 2nd, 3rd, 4th, in sentences, what will be the best way to write these? Also, what about numbers?

What is the most correct form for 3 in ordinal form: 3rd or 3d? I know both are valid. But i heard that 3rd is something like spoken form and it's grammatically correct to use 3d.