Public class TEC_NumtoRupees
{
}
---------------------------------------------------------------------------------------------------------------------------------------------
converting the number to text based on currency
---------------------------------------------------------------------------------------------------------------------------------------------
public static Tempstr currencyConversion(Real _num,CurrencyCode _currencyCode)
{
str 200 returntxt;
;
//nivasu
if(_num < 0)
{
_num = _num * -1;
}
switch(_currencyCode)
{
case "INR":
returntxt = TEC_NumtoRupees::numberToRupeesInPaise_Invoice(_num);
break;
case "MYR":
returntxt = TEC_NumtoRupees::numeralsToRinggit(_num);
break;
case "SGD":
returntxt = TEC_NumtoRupees::numeralsToDollarTxt(_num);
break;
case "USD":
returntxt = TEC_NumtoRupees::numeralsToDollarTxt(_num);
break;
case "CAD":
returntxt = TEC_NumtoRupees::numeralsToDollarTxt(_num);
break;
case "GBP":
returntxt = TEC_NumtoRupees::numeralsTopoundTxt(_num);
break;
// Added by nivasu - converting the number to text based on currency "AED" - >start
case "AED":
returntxt = TEC_NumtoRupees::numeralsToDirhamsTxt(_num);
break;
// Added by nivasu - converting the number to text based on currency "AED" --> end
// Added by nivasu - converting the number to text based on currency "SAR" - >start
case "SAR":
returntxt = TEC_NumtoRupees::numeralsToSARTxt(_num);
break;
//Added by nivasu - converting the number to text based on currency "AED" --> end
// Added by nivasu - converting the number to text based on currency "OMR" --> Start
case "OMR":
returntxt = TEC_NumtoRupees::numeralsToOMRTxt(_num);
break;
//5-Jan-2018, Added by nivasu - converting the number to text based on currency "OMR" <-- End
//8-Aug-2018, Added by nivasu - converting the number to text based on currency "THB" --> Start
case "THB":
returntxt = TEC_NumtoRupees::numeralsToTHBTxt(_num);
break;
//8-Aug-2018, Added by nivasu - converting the number to text based on currency "THB" <-- End
//11-Nov-2018, Added by nivasu - converting the number to text based on currency "QAR" --> Start
case "QAR":
returntxt = TEC_NumtoRupees::numeralsToQARTxt(_num);
break;
//11-Nov-2018, Added by nivasu - converting the number to text based on currency "QAR" <-- End
case "CHF":
returntxt = TEC_NumtoRupees::numeralsToCHFTxt(_num);
break;
case "EUR":
returntxt = TEC_NumtoRupees::numeralsToEURTxt(_num);
break;
}
return returntxt;
}
static void main(Args args)
{
TEC_NumtoRupees nr;
;
nr=new TEC_NumtoRupees();
}
---------------------------------------------------------------------------------------------------------------------------------------------
converting the number to text based on currency
---------------------------------------------------------------------------------------------------------------------------------------------
public static Tempstr numberToAllCurrrency(Real _num,CurrencyCode _currencyCode)
{
int numOfPennies = frac(_num)*100 mod 100;
real test = round(_num,0);
int paise;
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, lakhs, crores;
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 10000000 :
returntxt = returntxt + ' ' + crores;
_test = _test MOD 10000000;
break;
case 100000 :
returntxt = returntxt + ' ' + lakhs;
_test = _test MOD 100000;
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";
lakhs = "Lakh";
crores = "Crore";
test = checkPower(test, 10000000);
test = checkPower(test, 100000);
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 + ' ' + "@SYS5534"+' '+CurrencyOnlineConversion::kpmg_Find(_currencyCode,Affix::Suffix).Name;
}
paise=numofPennies;
if(paise)
{
if(paise >=20)
{
numofTenths= paise DIV 10;
returntxt=returntxt + ' '+tenths[numofTenths];
numofTenths = numofTenths MOD 10;
paise=paise MOD 10;
}
if(paise >=1)
{
numOfTenths=paise;
returntxt=returntxt+' '+ ones[numOfTenths];
}
returntxt=returntxt + " Paise";
}
if (returntxt == "")
return returntxt;
return returntxt +" Only";
}
---------------------------------------------------------------------------------------------------------------------------------------------
- converting the number to text based on currency
---------------------------------------------------------------------------------------------------------------------------------------------
public static Tempstr numberToCurrency_Check(Real _num,CurrencyCode _currencyCode)
{
int numOfPennies = frac(_num)*100 mod 100;
real test = round(_num,0);
int paise;
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, lakhs, crores;
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 10000000 :
returntxt = returntxt + ' ' + crores;
_test = _test MOD 10000000;
break;
case 100000 :
returntxt = returntxt + ' ' + lakhs;
_test = _test MOD 100000;
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";
lakhs = "Lakh";
crores = "Crore";
test = checkPower(test, 10000000);
test = checkPower(test, 100000);
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 + ' ' + "@SYS5534"+' '+ "Paise";
}
paise=numofPennies;
if(paise)
{
if(paise >=20)
{
numofTenths= paise DIV 10;
returntxt=returntxt + ' '+tenths[numofTenths];
numofTenths = numofTenths MOD 10;
paise=paise MOD 10;
}
if(paise >=1)
{
numOfTenths=paise;
returntxt=returntxt+' '+ ones[numOfTenths];
}
}
if (returntxt == "")
return returntxt;
return returntxt +" Only";
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into Rupees
---------------------------------------------------------------------------------------------------------------------------------------------
public static Tempstr numberToRupees(Real _num)
{
int numOfPennies = frac(_num)*100 mod 100;
real test = round(_num,0);
int paise;
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, lakhs, crores;
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 10000000 :
returntxt = returntxt + ' ' + crores;
_test = _test MOD 10000000;
break;
case 100000 :
returntxt = returntxt + ' ' + lakhs;
_test = _test MOD 100000;
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";
lakhs = "Lakh";
crores = "Crore";
test = checkPower(test, 10000000);
test = checkPower(test, 100000);
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 + ' ' + "@SYS24250";//"@SYS5534";
}
paise=numofPennies;
if(paise)
{
if(paise >=20)
{
numofTenths= paise DIV 10;
returntxt=returntxt + ' '+tenths[numofTenths];
numofTenths = numofTenths MOD 10;
paise=paise MOD 10;
}
if(paise >=1)
{
numOfTenths=paise;
returntxt=returntxt+ ' '+ones[numOfTenths];
}
}
if (returntxt == "")
return returntxt;
return returntxt+" Only";
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting rupees to pise
---------------------------------------------------------------------------------------------------------------------------------------------
public static Tempstr numberToRupeesInPaise(Real _num)
{
int numOfPennies = frac(_num)*100 mod 100;
real test = round(_num,0);
int paise;
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, lakhs, crores;
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 10000000 :
returntxt = returntxt + ' ' + crores;
_test = _test MOD 10000000;
break;
case 100000 :
returntxt = returntxt + ' ' + lakhs;
_test = _test MOD 100000;
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";
lakhs = "Lakh";
crores = "Crore";
test = checkPower(test, 10000000);
test = checkPower(test, 100000);
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 + ' ' + "@SYS5534";//"@SYS24250";
}
paise=numofPennies;
if(paise)
{
if(paise >=20)
{
numofTenths= paise DIV 10;
returntxt=returntxt + ' '+tenths[numofTenths];
numofTenths = numofTenths MOD 10;
paise=paise MOD 10;
}
if(paise >=1)
{
numOfTenths=paise;
returntxt=returntxt+ ' '+ones[numOfTenths];
}
returntxt=returntxt + " Paise";
}
if (returntxt == "")
return returntxt;
return returntxt+" Only";
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with INR language converting the number to text based on INR currency
---------------------------------------------------------------------------------------------------------------------------------------------
public static Tempstr numberToRupeesInPaise_Invoice(Real _num)
{
int numOfPennies = frac(_num)*100 mod 100;
real test = round(_num,0);
int paise;
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, lakhs, crores;
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 10000000 :
returntxt = returntxt + ' ' + crores;
_test = _test MOD 10000000;
break;
case 100000 :
returntxt = returntxt + ' ' + lakhs;
_test = _test MOD 100000;
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";
lakhs = "Lakh";
crores = "Crore";
// millions = "@SYS26653";
// billions = "@SYS26654";
// test = checkPower(test, 1000000000);
test = checkPower(test, 10000000);
test = checkPower(test, 100000);
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 + ' ' + "@SYS5534";//"@SYS24250";
}
paise=numofPennies;
if(paise)
{
if(paise >=20)
{
numofTenths= paise DIV 10;
returntxt=returntxt + ' '+tenths[numofTenths];
numofTenths = numofTenths MOD 10;
paise=paise MOD 10;
}
if(paise >=1)
{
numOfTenths=paise;
returntxt=returntxt+ ' '+ones[numOfTenths];
}
returntxt=returntxt + " Paise";
}
if (returntxt == "")
return returntxt;
return "Rupees" + returntxt+" Only";
//return returntxt+" Only";
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with Thai AED language converting the number to text based on AED currency
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsToDirhamsTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000 :
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
// test = checkPower(test, 1000000000000);
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'dirhams' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + ' fils';
}
else
returntxt = returntxt + ' fils' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+' fils';
}
}
else
{
returntxt = returntxt + ' ' + 'dirhams' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with Thai Doller language converting the number to text based on Doller currency
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsToDollarTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000 :
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
// test = checkPower(test, 1000000000000);
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'Dollars' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\tCents';
}
else
returntxt = returntxt + '\tCents' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\tCents';
}
}
else
{
returntxt = returntxt + ' ' + 'Dollars' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with Thai pound language converting the number to text based on pound currency
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsTopoundTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000 :
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'Pounds' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\t Penny';
}
else
returntxt = returntxt + '\t Penny' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\t Penny';
}
}
else
{
returntxt = returntxt + ' ' + 'Pounds' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with Thai BAT language converting the number to text based on Malaysian currency
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsToRinggit(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000:
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'ringgits ' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\t sen';
}
else
returntxt = returntxt + '\t sen' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ringgits' + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\t sen';
}
}
else
{
returntxt = returntxt + ' ' + 'ringgits' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
converting the number to text based on currency "SAR"
static TempStr numeralsToSARTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000 :
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
// test = checkPower(test, 1000000000000);
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'Riyal' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\t halalah';
}
else
returntxt = returntxt + '\t halalah' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\t halalah';
}
}
else
{
returntxt = returntxt + ' ' + 'Riyal' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with OMR language
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsToOMRTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000 :
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'Omani riyal' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\t baisa';
}
else
returntxt = returntxt + '\t baisa' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\t baisa';
}
}
else
{
returntxt = returntxt + ' ' + 'Omani riyal' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with DINAM language
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsToQARTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000 :
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'Qatar riyals' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\t dirhams';
}
else
returntxt = returntxt + '\t dirhams' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\t dirhams';
}
}
else
{
returntxt = returntxt + ' ' + 'Qatar riyal' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with Thai BAT language
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsToTHBTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000 :
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'Thai Baht' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\t Thai Baht';
}
else
returntxt = returntxt + '\t Thai Baht' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\t Thai Baht';
}
}
else
{
returntxt = returntxt + ' ' + 'Thai Baht' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with europe language
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsToCHFTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000:
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'Swiss Franc ' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\t sen';
}
else
returntxt = returntxt + '\t sen' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' Swiss Franc' + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\t sen';
}
}
else
{
returntxt = returntxt + ' ' + 'Swiss Franc' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
---------------------------------------------------------------------------------------------------------------------------------------------
Converting numaral values into text with europe language
---------------------------------------------------------------------------------------------------------------------------------------------
static TempStr numeralsToEURTxt(real _num)
{
int numOfPennies = (decround(frac(_num), 2) * 100) mod 100;
real test = _num - frac(_num);
int numOfTenths;
str 20 ones[19], tenths[9], hundreds, thousands, millions, billions, trillions;
int64 temp;
str 200 returntxt;
real modOperator(real a1, real a2)
{
int tmpi;
real tmp1, tmp2;
tmp1 = a1 / a2;
tmpi = real2int(tmp1);
tmp2 = tmpi;
return (tmp1 - tmp2)*a2;
}
real 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 1000000000000:
returntxt = returntxt + ' ' + trillions;
_test = _test mod 1000000000000;
break;
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";
trillions = "@SYS101697";
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 = real2int(test);
returntxt = returntxt + ' ' + ones[numOfTenths];
}
if(numOfPennies != 0)
{
if (numOfPennies >= 20)
{
numOfTenths = numOfPennies DIV 10;
returntxt = returntxt + ' ' + 'Euro ' +' ' + "@SYS5534" + ' ' + tenths[numofTenths];
numOfTenths = numOfTenths MOD 10;
numOfPennies = numOfPennies MOD 10;
if (numOfPennies >= 1)
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' ' + ones[numOfTenths] + '\t cent';
}
else
returntxt = returntxt + '\t cent' ;
}
else
{
numOfTenths = numOfPennies;
returntxt = returntxt + ' Euro' + ' ' + "@SYS5534" + ' ' + ones[numofTenths]+'\t cent';
}
}
else
{
returntxt = returntxt + ' ' + 'Euro' ;
}
returntxt = returntxt + ' Only';
return returntxt;
}
Comments
Post a Comment