s:=334726;
s:=inttohex(s,1);//一样:0051b86
//s:=inttohex(s,2);//一样:0051b86
//s:=inttohex(s,4); //一样:0051b86

解决方案 »

  1.   

    IntToHex converts a number into a string containing the number's hexadecimal (base 16) representation. Value is the number to convert. Digits indicates the minimum number of hexadecimal digits to return.
    -- 返回的最小位数
      

  2.   

    s:=334726;
    ShowMessage(inttohex(s,1));  //51b86
    //ShowMessage(inttohex(s,2));//51b86
    //ShowMessage(inttohex(s,4));//51b86
    //ShowMessage(inttohex(s,5));//51b86
    //ShowMessage(inttohex(s,6));//051b86
    //ShowMessage(inttohex(s,9));//000051b86当然有用啊,就是如果位数不足时补足位数,要显示出来看才看得出。