Check amout printing display

Hi

I want to change check amount in words display to specific text. Example- Right now my current setup is printing checks as “*****Thirty Canadian dollar and 40/100” and I need to change this to “Thirty Dollars And 40 Cents”

please suggest solution for this issue

Thanks in advnace

Girish

Girish,

Please refer this to your Technical team. I think this requires modification in the Class if the regular file format fields cannot accomodate this requirement. In order to modify the class however you have to have a license. Call up your partner/consultants to inquire.Thanks

Dragon

hi Girish

As Dragon said we dont have option unless we modify the class.But we use some small logic to implement this.Please execute the below job.You will get the required result.

static void Job1(Args _args)
{
;
print subStr(global::numeralsToTxt_EN(26.42),1, strlen(global::numeralsToTxt_EN(26.42))-4)+’ cents only’;
pause;
}

Hi Girish,

Add this method in the Global class and call it…

static TempStr NR_numeralsToTxt(Real _num)
{
int numOfPennies = frac(_num)*100 mod 100;
int test = round(_num,0);

int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions;

int temp;
str 200 returntxt;

int checkPower(int _test, int _power)
{
int numOfPower;

if (_test >= _power)
{
numOfPower = _test DIV _power;
if (numOfPower >= 100)
{
temp = numOfPower DIV 100;
returntxt = returntxt + ’ ’ + ones[temp] + ’ ’ + hundreds;
numOfPower = numOfPower MOD 100;
}
if (numOfPower >= 20)
{
temp = numOfPower DIV 10;
returntxt = returntxt + ’ ’ + tenths[temp];
numOfPower = numOfPower MOD 10;
}
if (numOfPower >= 1)
{
returntxt = returntxt + ’ ’ + ones[numOfPower];
numOfPower = numOfPower MOD 10;
}
switch(_power)
{
case 1000000000 :
{
returntxt = returntxt + ’ ’ + billions;
_test = _test MOD 1000000000;
break;
}
case 1000000 :
{
returntxt = returntxt + ’ ’ + millions;
_test = _test MOD 1000000;
break;
}
case 1000 :
{
returntxt = returntxt + ’ ’ + thousands;
_test = _test MOD 1000;
break;
}
case 100 :
{
returntxt = returntxt + ’ ’ + hundreds;
_test = _test MOD 100;
break;
}
}
}
return _test;
}

ones[1] = “@SYS26620”;
ones[2] = “@SYS26621”;
ones[3] = “@SYS26622”;
ones[4] = “@SYS26626”;
ones[5] = “@SYS26627”;
ones[6] = “@SYS26628”;
ones[7] = “@SYS26629”;
ones[8] = “@SYS26630”;
ones[9] = “@SYS26631”;
ones[10] = “@SYS26632”;
ones[11] = “@SYS26633”;
ones[12] = “@SYS26634”;
ones[13] = “@SYS26635”;
ones[14] = “@SYS26636”;
ones[15] = “@SYS26637”;
ones[16] = “@SYS26638”;
ones[17] = “@SYS26639”;
ones[18] = “@SYS26640”;
ones[19] = “@SYS26641”;

tenths[1] = ‘Not used’;
tenths[2] = “@SYS26643”;
tenths[3] = “@SYS26644”;
tenths[4] = “@SYS26645”;
tenths[5] = “@SYS26646”;
tenths[6] = “@SYS26647”;
tenths[7] = “@SYS26648”;
tenths[8] = “@SYS26649”;
tenths[9] = “@SYS26650”;

hundreds = “@SYS26651”;
thousands = “@SYS26652”;
millions = “@SYS26653”;
billions = “@SYS26654”;

test = checkPower(test, 1000000000);
test = checkPower(test, 1000000);
test = checkPower(test, 1000);
test = checkPower(test, 100);

if (test >= 20)
{
numOfTenths = test DIV 10;
returntxt = returntxt + ’ ’ + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
test = test MOD 10;
}
if (test >= 1)
{
numOfTenths = test;
returntxt = returntxt + ’ ’ + ones[numOfTenths];
}

if (numOfPennies)
{

returntxt = returntxt + ’ ’ + ‘dollar’ + ’ ’ + ‘and’;
if (numOfPennies >= 20)
{
temp = numOfPennies DIV 10;
returntxt = returntxt + ’ ’ + tenths[temp];
numOfPennies = numOfPennies MOD 10;
}
if (numOfPennies >= 1)
{
returntxt = returntxt + ’ ’ + ones[numOfPennies];
//numOfPower = numOfPower MOD 10;
}

returntxt = returntxt + ’ ’ + ‘cents only’;
//returntxt = ‘***’ + returntxt + ’ ’ + “@SYS5534” + ’ ’ + num2str(numOfPennies,0,0,0,0) + ‘/100’;
// end
}
else
{
returntxt = returntxt + ’ ’ + ‘only’;
//returntxt = ‘***’ + returntxt + ’ ’ + “@SYS5534” + ’ ’ + ‘00/100’;
}

return returntxt;

}

If you give the num as 30.75

Result is Thirty dollar and Seventy Five cents only

Naresh Kolli