Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
12. Dez 2013
Wow, math is I looked for, thank you! :-D
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
12. Dez 2013
Yes. But I thought about something more low level, like bits shift, etc. to boost performance. Anyway thanks for this :)
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
12. Dez 2013
Thanks guys, but I forgot about one the most important thing - I don't want string, just math or binary math :wink:
So, for example we have 1234. Now we need get second digit, result should be 2. In my sample I'll get all digits, I need just specified one on specified position in number, not all.
Forum: Object-Pascal / Delphi-Language
Delphi
by WojTec,
12. Dez 2013
How to get n digit from number, where n is position in numer?
To get all I have:
while Number > 0 do
begin
Digit := Number mod 10;
Number := Number div 10;
end;