请高手麻烦帮看一下,问题到底出在什么地方?要求是:¥1245.33。但实际是:1245.3¥或者是:¥ 1245.33.
string ld_value,ld_value01,ld_value02,ld_value03,ls_word
dec LD_NUM,LD_NUM1,LD_NUM2,LD_NUM3
long ll_count_id,L_J
integer al_row
STRING LS_VALUE,ls_xs,ls_sz,ls_col,LS_ZS,LS_TEMP
long ll_len,j,ll_pos
BOOLEAN LB_LEN1
LB_LEN1=TRUE
al_row = dw_base.getrow()
//得到数据窗口的列名
string ls_column_name
ls_column_name = dw_base.describe("#" + string(L_J) + ".Name")
//--------------------------//
//以下程序段设置paymoney列的显示格式
ld_num = dw_base.GetItemNumber(al_row,"paymoney")
If ld_num > 0 then
LS_VALUE = STRING(ld_num,"#0.00")
ll_pos = pos(ls_value,".") //查找字符串中小数点的位置
//以下程序段确保两位小数
if ll_pos>0 then
ls_xs = right(ls_value,len(ls_value) - ll_pos ) //小数
ls_zs = left(ls_value,ll_pos - 1) //整数
ls_xs = LEFT(LS_XS,2)
if len(ls_xs) = 1 then
ls_xs = ls_xs + "0"
end if
ELSE
LS_XS = "00"
ls_zs = ls_value
end if
LL_LEN = LEN(LS_ZS) //得到字符串的长度
for j = 1 to 9
ls_col = "f_7" + string(j)
dw_1.setitem(al_row,ls_col,ls_sz) //al_row = 1
next
if ll_len = 1 then //EXAM :0.12
LS_SZ = LEFT(LS_ZS,1)
if ls_sz = '0' then
ls_sz = ""
end if
LS_COL = "f_73"
dw_1.setitem(al_row,ls_col,ls_sz)
LB_LEN1 = FALSE
end if
DO while (ll_len > 0 AND LB_LEN1 = TRUE)
LS_SZ = LEFT(LS_ZS,1) //从字符串中得到最左边指定长度的字符
LS_ZS = RIGHT(LS_ZS,LEN(LS_ZS) - 1) //从字符串中得到最右边指定长度的字符
LS_COL = "f_7" + string(ll_len + 2)
dw_1.setitem(al_row,ls_col,ls_sz)
ll_len = len(ls_ZS)
loop
dw_1.setitem(al_row,"f_72",left(ls_xs,1))
dw_1.setitem(al_row,"f_71",right(ls_xs,1))
End IF
//-----------------------------------//
if ll_len < 9 then
LL_LEN = LEN(LS_ZS) //得到字符串的长度
LS_COL ="f_7" + string(LL_LEN - 1)
ls_word = "¥"
// dw_1.setitem(al_row,ls_col,ls_sz) //al_row = 1