Not performant, but working:
Delphi-Quellcode:
function GetDigit(Number : int64; Index : byte) : byte;
var
NumStr : string;
begin
NumStr := IntToStr(Number);
// Index starts with 0 from the right
result := StrToInt(copy(NumStr, length(NumStr)-Index, 1));
end;