2011-06-19 6 views
0

こんにちは私はasp.netのWebサイトでcrystalレポートを開発しました 私は1,200,000(インドの通貨)のような通貨フォーマットを設定したいが、現在の通貨はMy Server Hosted Currency Formatをとり、私は働いていたインドの会社ので、私は結晶のレポートのためのインディアンフォーマットで通貨を変換する任意のフォーマット//通貨問題Crystalレポートで

答えて

1
-- You can use below said code to your report part; 

CStr({@FieldName}, "##,##,##,###.##") 

And you are working for Indian Company, you will needed in words also. To write in words, use below said code; 

numbervar RmVal:=0; 
numbervar Amt:=0; 
numbervar pAmt:=0; 
stringvar InWords :="Rupees "; 

Amt := {@FieldName} ; 


if Amt > 10000000 then RmVal := truncate(Amt/10000000); 
if Amt = 10000000 then RmVal := 1; 

    if RmVal = 1 then 
     InWords := InWords + " " + towords(RmVal,0) + " crore" 
    else 
     if RmVal > 1 then InWords := InWords + " " + towords(RmVal,0) + " crores"; 


    Amt := Amt - Rmval * 10000000; 

    if Amt > 100000 then RmVal := truncate(Amt/100000); 
    if Amt = 100000 then RmVal := 1; 

    if RmVal = 1 then 
     InWords := InWords + " " + towords(RmVal,0) + " lakhs" 
    Else 
     If RmVal > 1 then InWords := InWords + " " + ToWords(RmVal,0) + " Lakhs"; 

     Amt := Amt - Rmval * 100000; 

     if Amt > 0 then InWords := InWords + " " + towords(truncate(Amt),0); 

     pAmt := (Amt - truncate(Amt)) * 100; 

     if pAmt > 0 then 
      InWords := InWords + " and " + towords(pAmt,0) + " paisa only" 
     else 
      InWords := InWords + " only"; 

     ProperCase(InWords) 
関連する問題