Sign in Join
FPDoc Onlineexperiment

Dec2Numb function

In unit StrUtils

Convert a decimal number to a string representation, using given a base.

Declaration

pascal
function Dec2Numb(N: LongInt; Len: Byte; Base: Byte): string

Arguments

N

Number to represent.

Len

Minimal length of the returned string.

Base

Base to use when converting.

Function result

The representation of the given number.

Description

Dec2Numb converts N to its representation using base Base. N must be a positive integer. The resulting string is left-padded with zeroes till it has length Len. Base must be in the range 2-36 to be meaningful, but no checking on this is performed.

Errors

If Base is out of range, the resulting string will contain unreadable (non-alphanumeric) characters.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.