Home MathPack Math1 Conversion Decimal 

See also: Hex, Octal, Bin, GrayCode, ScanDecimal, ScanFPNum, Roman 

Decimal 

Unit:  SDL_math1  Class:  None  Declaration:  function Decimal (innum: longint; places: byte): string; 
The function Decimal converts the integer number innum to an ASCII string which is the decimal representation of that number but the leading spaces replaced by zeros. The number is written with a variable number of places, which can be defined by the parameter places (1..255). A negative number will be displayed with a leading '' character, thus increasing the number characters output by one.
Hint: 
If the value of the parameter places is less than one the value is automatically restricted to 1. If places does not suffice to display the decimal representation, the resulting string is truncated. 
Example: 
write (Decimal (2334,8)); writes the number 2334 using decimal notation with 8 characters and leading zeros ('00002334');

