请修改印度货币格式的代码 [英] please modify the code which is in indian currency format

查看:93
本文介绍了请修改印度货币格式的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...大家...

我设计了一个水晶报表来显示印度的总数
货币格式效果很好...
以下是我的代码.

hi... everybody...

i''ve designed one crystal report to display the total number in indian
currency format which works good...
following is my code.

numbervar RmVal:=0; 
numbervar Amt:=0; 
numbervar pAmt:=0; 
stringvar InWords :=" ";
numbervar totalAmt;
totalAmt := Sum ({employee.salary});
Amt := totalAmt;

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

Amt := Amt - Rmval * 100000;

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

if RmVal =1 then 
    Inwords := InWords + " " + towords(RmVal,0) + "Thousand"
Else
    if RmVal > 1 then 
        InWords := InWords + " " + towords(RmVal,0) + "thousand ";
Amt := Amt - RmVal * 1000;
        
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 + " rupees only";

UPPERCASE(InWords)



如果我以2,13,45,000的文字显示为(仅2色蒂尔斯·拉格斯四十五万卢比)是正确的...

但是当我给出2,00,45,000时,它将显示错误的值
即(仅限两批一千卢比和卢比)

我希望在这里将其打印为(仅两色四万五千卢比)...

请帮助我...



if i give 2,13,45,000 display in words as (TWO CRORES THIRTEEN LAKHS FORTY-FIVETHOUSAND RUPEES ONLY ) which is correct...

but when i give 2,00,45,000 it will display wrong value
i.e(TWO CRORES ONE LAKH ONETHOUSAND RUPEES ONLY )

i want here to be printed as (TWO CRORES FORTY-FIVE THOUSAND RUPEES ONLY ) which i want...

please help me...

推荐答案

本文最近在CodeProject中发布.

将数字货币转换为单词(仅适用于印度货币) [
This article was posted recently here in CodeProject.

Convert Numeric Currency into words ( For INDIAN Currency Only )[^]

Hope this will help you!


尝试一下.让我知道它是否有效.
Try this. Let me know if it''s working.
numbervar RmVal:=0; 
numbervar Amt:=0; 
numbervar pAmt:=0; 
stringvar InWords :=" ";
numbervar totalAmt;
totalAmt := Sum ({employee.salary});
Amt := totalAmt;

if Amt >= 10000000 then
    RmVal := truncate(Amt/10000000); 
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;

RmVal := 0;
if Amt >= 100000 then 
    RmVal := truncate(Amt/100000); 
if RmVal = 1 then 
    InWords := InWords + " " + towords(RmVal,0) + " lakh"
Else
    If RmVal > 1 then 
        InWords := InWords + " " + ToWords(RmVal,0) + " Lakhs";
Amt := Amt - Rmval * 100000;

RmVal := 0;
if Amt >= 1000 then 
    RmVal := truncate(Amt/1000);
if RmVal =1 then 
    Inwords := InWords + " " + towords(RmVal,0) + "Thousand"
Else
    if RmVal > 1 then 
        InWords := InWords + " " + towords(RmVal,0) + "thousand ";
Amt := Amt - RmVal * 1000;
        
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 + " rupees only";

UPPERCASE(InWords)


这篇关于请修改印度货币格式的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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