#
# Program name...: ccl_numstr.4gl
# Descriptions...: 把p1 的數字 轉換成 p2 長度的字串
# Date & Author..: 03/09/08 by Hiko
# Usage..........: CALL cl_numstr (p1,p2)
#傳回...轉換成功 轉換後的字串
# 轉換失敗 傳回NUKK
DATABASE ds
GLOBALS "../../config/top.global" #FUN-7C0053
function ccl_numstr(p1,p2)
define p1,l_ret,l_ret1 string
define p2 integer
define l_len integer
define l_i integer
if ccl_isnum(p1) then
let l_ret1='00000000000000000000000000000000000',p1
let l_len=p1.getLength( )
let l_i=l_len-p2+1
let l_ret=l_ret1.substring(l_i,p2)
else
return NULL
end if
end function
沒有留言:
張貼留言