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 に答える