如何在Crystal报告中的单词中转换金额(例如,Lakh,例如1,02,754)..?

时间:2017-03-23 04:42:01

标签: sql-server c#-4.0

我想用单词转换金额(Lakh,例如1,02,754)....

if UpperCase(left(ToWords(ToNumber(RIGHT(CSTR({vwDSRAirInvoiceReport.InvoiceTotal}),2))),len(ToWords(ToNumber(RIGHT(CSTR({vwDSRAirInvoiceReport.InvoiceTotal}),2))))-12)) ="ZERO" then
{vwDSRAirInvoiceReport.Currency}&" . "& UPPERCASE(TOWORDS(102754,0))&" ONLY"
else
{vwDSRAirInvoiceReport.Currency}&" . "&(Split(UPPERCASE(TOWORDS({vwDSRAirInvoiceReport.InvoiceTotal}))," AND"))[1]+ " AND POINT " + UpperCase(left(ToWords(ToNumber(RIGHT(CSTR({vwDSRAirInvoiceReport.InvoiceTotal}),2))),len(ToWords(ToNumber(RIGHT(CSTR({vwDSRAirInvoiceReport.InvoiceTotal}),2))))-12)) + " ONLY "

3 个答案:

答案 0 :(得分:0)

有多种方法可以填充它。它取决于你。 请尝试使用印度货币。

numbervar RmVal:= 0;
numbervar Amt:= 0;
numbervar pAmt:= 0;
stringvar InWords:=“”;
Amt:= Round({@ Total Amount},0);
如果Amt> 10000000然后RmVal:= truncate(Amt / 10000000);
如果Amt = 10000000则RmVal:= 1;
如果RmVal = 1那么 InWords:= InWords +“”+ towords(RmVal,0)+“crore”
否则
如果RmVal> 1然后InWords:= InWords +“”+ towords(RmVal,0)+“crores”;

Amt:= Amt - Rmval * 10000000;
如果Amt> 100000然后RmVal:= truncate(Amt / 100000);
如果Amt = 100000则RmVal:= 1;
如果Amt = 0则RmVal:= 0;
如果RmVal> = 1那么
InWords:= InWords +“”+ towords(RmVal,0)+“lakhs”;

Amt:= Amt - Rmval * 100000;
如果Amt> 0然后InWords:= InWords +“”+ towords(truncate(Amt),0);
pAmt:=(Amt - truncate(Amt))* 100;
如果pAmt> 0然后
InWords:= InWords +“和”+ towords(pAmt,0)+“paisa only”
否则
InWords:= InWords +“only”;
大写(InWords)

答案 1 :(得分:0)

Crystal公式中的单词数字:

ProperCase(ToWords(800000, 0) )

Stringvar str := "1,102,754";
ProperCase( ToWords(Int(tonumber(str)), 0))

答案 2 :(得分:0)

您可以从SQL中获取逗号分隔的字符串,然后传递给crystal report

select CONVERT(nvarchar, CAST(salary AS money), 1)