0

我有以下公式命名@newitemQuant

WhileReadingRecords;
StringVar text := Totext ( {AR_SalesBySalesPersonDenim;1.quantity} , 6 , ""  )  ;  
NumberVar end  := length ( text ) ;
NumberVar clip :=

    (if  Val ( text [ end - 6 to end ] ) = 0 then 1 else 0 ) +
    (if  Val ( text [ end - 5 to end ] ) = 0 then 1 else 0 ) +
    (if  Val ( text [ end - 4 to end ] ) = 0 then 1 else 0 ) +
    (if  Val ( text [ end - 3 to end ] ) = 0 then 1 else 0 ) +
    (if  Val ( text [ end - 2 to end ] ) = 0 then 1 else 0 ) +
    (if  Val ( text [ end - 1 to end ] ) = 0 then 1 else 0 ) +
    (if  Val ( text [ end - 0 to end ] ) = 0 then 1 else 0 )  ;

text [ 1 to Length ( text ) - clip ]

这基本上将我{AR_SalesBySalesPersonDenim;1.quantity}的具有 NUMBER 数据类型的数据库字段转换为 STRING,然后再对其进行操作。并在报告中显示生成的 STRING。

现在我想在报告中放置一个结果字符串字段的摘要。无法做到这一点。

我尝试ToNumber()在同一个公式和一个新公式中使用:

numbervar fVal;
fVal := ToNumber({@newitemQuant}). 

但没有进展。提前致谢

4

1 回答 1

0

我找到了答案。

基本上要在报告中处理数字中的小数位数,只需右键单击字段选择格式对象->数字选项卡->在小数公式中->输入

If CurrentFieldValue = Int(CurrentFieldValue) Then
0 
else
2

完毕。其中 2 是无论如何您要显示的最大小数位数。

谢谢

于 2011-12-14T02:12:39.810 回答