Advertisement
TLama

Untitled

May 3rd, 2015
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.40 KB | None | 0 0
  1. function CountDigits(Value: Cardinal): Cardinal; inline;
  2. begin
  3.   case Value of
  4.     0..9: Result := 1;
  5.     10..99: Result := 2;
  6.     100..999: Result := 3;
  7.     1000..9999: Result := 4;
  8.     10000..99999: Result := 5;
  9.     100000..999999: Result := 6;
  10.     1000000..9999999: Result := 7;
  11.     10000000..99999999: Result := 8;
  12.     100000000..999999999: Result := 9;
  13.   else
  14.     Result := 10;
  15.   end;
  16. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement