Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

Int32 on input should have specified numbers count on output

  Alt 14. Okt 2010, 09:48
Delphi-Version: 5
Hi,

I have another question for you.

On input I have a number <> 0, eg. -542, 4558846, 95423, -55487130 (Int32). On output I want to specified number of input digits whithout converting to string (trim or extend if needed), eg. if digits count = 5 for above numbers output will be:

-55487130 --> 55487 (if < 0 then call Abs())
-542 --> 54200 (if number is < than counter then fill with 0)
4558846 --> 45588
95423 --> 95423

Do you have some idea how can do it?
  Mit Zitat antworten Zitat