如何汇总金额 [英] How to conver amount in words

查看:95
本文介绍了如何汇总金额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是我用于单词转换的公式,但是当这个数量存在时,它会显示错误的单词格式值





 numbervar RmVal:= 0; 
numbervar Amt:= 0;
numbervar pAmt:= 0;
stringvar InWords:=卢比;

Amt:= tonumber({?Value});


如果Amt> 10000000然后RmVal:= truncate(Amt / 10000000);
如果Amt = 10000000则RmVal:= 1;

如果RmVal = 1则
InWords:= InWords ++ ProperCase(towords(RmVal,0))+crore
否则如果RmVal> 1然后InWords:= InWords ++ ProperCase(towords(RmVal,0))+crores;



Amt:= Amt - Rmval * 10000000;

如果Amt> 100000然后RmVal:= truncate(Amt / 100000);
如果Amt = 100000则RmVal:= 1;

如果RmVal = 1则
InWords:= InWords ++ ProperCase(towords(RmVal,0))+lakh
否则
如果RmVal> ; 1然后InWords:= InWords ++ ProperCase(ToWords(RmVal,0))+Lakhs;


Amt:= Amt - Rmval * 100000;

如果Amt> 0然后InWords:= InWords ++ ProperCase(towords(truncate(Amt),0));


pAmt:=(Amt - truncate(Amt))* 100;如果pAmt>

0然后
InWords:= InWords +和+ ProperCase(towords(pAmt,0))+paise only
else
InWords:= InWords +only;

ProperCase(InWords)





如果此公式需要更改,请提示

让我知道asap

解决方案

让我们看看其他人是否有同样的问题:将数字货币转换为单词(仅限印度货币)(优化) [ ^ ]。

Hi here is the formula that i used for word conversion but in this when amount exists one crore it displays wrong value in the word format


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

Amt := tonumber({?Value} ); 


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

   if RmVal = 1 then 
        InWords := InWords + " " + ProperCase (towords(RmVal,0)) + " crore" 
   else if RmVal > 1 then InWords := InWords + " " + ProperCase (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 + " " + ProperCase (towords(RmVal,0)) + " lakh"
    Else
        If RmVal > 1 then InWords := InWords + " " + ProperCase (ToWords(RmVal,0)) + " Lakhs";


        Amt := Amt - Rmval * 100000; 

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


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

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

        ProperCase(InWords)



Kindly suggest if there is any changes needed in this formula,
let me know asap

解决方案

Let's look if someone else had the same problem: "Convert Numeric Currency into Words (For INDIAN Currency Only) (Optimized)"[^].


这篇关于如何汇总金额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆