【问题标题】:Amount in Words in Indian Format using Crystal Report使用 Crystal Report 以印度格式的单词金额
【发布时间】:2020-02-25 17:23:15
【问题描述】:

在水晶报表中我有sum{Total},它等于1128725.62

现在我使用以下代码将钱转换为文字金额

numberVar x :=(Sum({Command.Total}))- Int (Sum({Command.Total})) ;
    ProperCase (ToWords (Int (Sum({Command.Total})),0) + ', and ' + ToWords ((x * 100),0) + ' Paise Only')

它会将结果显示为

One Million On Hundred Twenty-Eight Thousand Seven Hundred Twenty-Five , And Sixty-two Paise Only

这不是印度格式,我实际上需要输出为

Eleven Lakh Twenty-Eight Thousand Seven Hundred Twenty-Five , And Sixty-two Paise Only

我需要做哪些更改任何帮助表示赞赏。

【问题讨论】:

    标签: c# crystal-reports windows-applications


    【解决方案1】:

    由于我不知道使用印度数字系统术语的任何自动方式,我建议您创建一个公式,其中将明确计算某些幂符号的因数(除以 10 的幂)并参考除了每次适当的名称。

    我给你举个例子,让你一百万,你可以继续,以防你将来遇到更多的人

    (如果我对数字准确性有误,请原谅我,我不熟悉印度数字系统)

    numberVar crorecount := Int(Sum({Command.Total})/10000000) ; //count of crores
    numberVar lakhcount := Int(Int(Sum({Command.Total}) - (crorecount*10000000))/100000); //count of lakhs
    numberVar decimal :=(Sum({Command.Total}))- Int (Sum({Command.Total})) ; //decimal part
    
    stringvar croreSubStr := iif(crorecount>0,ToWords(crorecount,0)+' crore',''); //string you will add at the final result if number is greater of 10000000
    stringvar lakhSubStr := iif(lakhcount>0,ToWords(lakhcount,0)+' lakh',''); //string you will add at the final result if number is greater of 100000
    
    ProperCase (croreSubStr+' '+lakhSubStr+' '+ToWords (Int (Sum({Command.Total})-(crorecount*10000000)-(lakhcount*100000)),0) + ', and ' + ToWords ((decimal * 100),0) + ' Paise Only')
    

    【讨论】:

      【解决方案2】:
      numberVar crorecount := Int({@Netamt}/10000000) ; //count of crores
      numberVar lakhcount := Int(Int({@Netamt} - (crorecount*10000000))/100000); //count of lakhs
      ////numberVar decimal :=({@Netamt})- Int ({@Netamt}) ; //decimal part
      stringvar croreSubStr := iif(crorecount>0,ToWords(crorecount,0)+' crore',''); //string you will add at the final result if number is greater of 10000000
      stringvar lakhSubStr := iif(lakhcount>0,ToWords(lakhcount,0)+' lakh',''); //string you will add at the final result if number is greater of 100000
      ProperCase (croreSubStr+' '+lakhSubStr+' '+ToWords (Int ({@Netamt})-(crorecount*10000000)-(lakhcount*100000),0)) +  'Only'
      

      【讨论】:

        猜你喜欢
        • 2016-10-29
        • 2023-03-19
        • 2013-12-06
        • 1970-01-01
        • 2014-05-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多