| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Converts an integer to a string of digits for a specified number base.
NtoC( <nInteger>|<cHex>, ;
[<nBase>] , ;
[<nLength> , ;
[<cPad>] ) --> cString
The function returns a character string. It holds the digit representation of <nIneger> for the specified number base. If there is an error, or <nLength> is specified too small, a character string filled with asterisks is returned.
| See also: | CtoN(), NumToHex() |
| Category: | CT:NumBits , Numbers and Bits |
| Source: | ct\numconv.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example displays results of NtoC() for different
// number bases.
PROCEDURE Main
? NtoC( 13 ) // result: 13
? NtoC( 13, 2 ) // result: 1101
? NtoC( 13, 16 ) // result: D
RETURN
http://www.xHarbour.com