Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QByteArray QByteArray::number ( int  n,
int  base = 10 
) [static]

Returns a byte array containing the string equivalent of the number n to base base (10 by default). The base can be any value between 2 and 36.

Example:

        int n = 63;
        QByteArray::number(n);              // returns "63"
        QByteArray::number(n, 16);          // returns "3f"
        QByteArray::number(n, 16).toUpper();  // returns "3F"

See also:
setNum(), toInt()

Definition at line 3531 of file qbytearray.cpp.

References setNum().

{
    QByteArray s;
    s.setNum(n, base);
    return s;
}


Generated by  Doxygen 1.6.0   Back to index