Large decimal numbers
Large decimal numbers
Hi guys,
does anyone knows how to work with large numbers (23 dec) ?
for example, we need to do next action
A=24840081102824244172700
B=97
X=A/B
Result = X - INT(X)
Problem is that xbase only use 18 decimals, no 23....
does anyone knows how to work with large numbers (23 dec) ?
for example, we need to do next action
A=24840081102824244172700
B=97
X=A/B
Result = X - INT(X)
Problem is that xbase only use 18 decimals, no 23....
Goran Radosic
Re: Large decimal numbers
No way, the limit is exceeded.
But it seems you're trying to calculate the "IBAN" - International Bank Account Number. You may look at my solution for this, to be found in the German Xbase Forum:
http://www.xbaseforum.de/viewtopic.php?f=6&t=6863
(2nd message)
But it seems you're trying to calculate the "IBAN" - International Bank Account Number. You may look at my solution for this, to be found in the German Xbase Forum:
http://www.xbaseforum.de/viewtopic.php?f=6&t=6863
(2nd message)
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Large decimal numbers
Yes, you are right... I need to calculate IBAN check number...
I look at this forum, but ... "ich nix verstehen" german language.... do you have on this on some other place?
I look at this forum, but ... "ich nix verstehen" german language.... do you have on this on some other place?
Goran Radosic
Re: Large decimal numbers
Just take the code (three functions) and ignore or delete the comments. You may call the function
with at least two parameters, the account number and the old numeric bank id ("Bankleitzahl" in germany). If done so, the country code defaults to "DE" (you may change this in line 3 of the function), if you want to submit a country code, fill the 3rd parameter with Space(22) or an existing IBAN to validate. The function shows how to fragment the large number and calculate the number stepwise. The function "NurZiffern" extracts all the digits from a string ("JustDigits").
Code: Select all
FUNCTION CalcIban(cCiBlz,cCiKonto,cCiIban,cCiLaenderCode)
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Large decimal numbers
TOM, IT'S WORKING !!!!!
I just put start konto to 7 decimal (in germany is 8) and I get right IBAN back !!
thank you !!!!!!!!!!!!!
I just put start konto to 7 decimal (in germany is 8) and I get right IBAN back !!
thank you !!!!!!!!!!!!!
Goran Radosic
Re: Large decimal numbers
Great!
You may take a look at the string padding. Account numbers are filled with trailing zeros in this version - but leading zeros may be correct (change PadR() to PadL()).
You may take a look at the string padding. Account numbers are filled with trailing zeros in this version - but leading zeros may be correct (change PadR() to PadL()).
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Large decimal numbers
Hi all
You can use the TORCH browser to translate any website from most popular language to another. Worked very well. Because of this unique capability it is my default internet browser.
Joe
You can use the TORCH browser to translate any website from most popular language to another. Worked very well. Because of this unique capability it is my default internet browser.
Joe
Re: Large decimal numbers
Google Translate does the same job. Be careful if source code is translated.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Large decimal numbers
This is how to calculate Mod(97) of any number of digits.
Jack Duijf
Code: Select all
//
// cNumber = "22152829123456987654322612"
//
// Check if cNumber with Mod 10,97 (ISO/IEC 7064:2003) model
//
For ni := 1 To Len(cNumber)
nValue := Asc(cNumber[ni])-48
nRet := ((nRet * 10 ) + nValue) % 97
Next ni
//
// The checksum is part of the calculation (last 2 digits)
// Calculate last 2 digits that result in Mod 97 = 1
//
nRet := nRet * 100
nRet := nRet % 97
nRet := 97 - nRet + 1
Regards,
Jack Duijf
Jack Duijf