Hallo
Am 07.01.2014 08:53, schrieb Werner Tietz:
in Python z.b:
def check_iban( iban ):
iban = iban.replace(' ','')
iban = sum([ int(iban[4:])*10**6,
(ord(iban[0].upper())-55)*10**4,
(ord(iban[1].upper())-55)*10**2,
int(iban[2:4]) ])
return iban % 97 == 1
..> check_iban('DE68 2105 0170 0012 3456 78')
..> True
Sorry, hier gings um die Prüfziffern - nicht um Validitäts-berechnung.
Dann:
def pruefsumme( iban ):
iban = iban.replace(' ','')
iban = sum([ int(iban[4:])*10**6,
(ord(iban[0].upper())-55)*10**4,
(ord(iban[1].upper())-55)*10**2,
int(iban[2:4]) ])
return '{:02d}'.format( 98 - iban % 97)
..> pruefsumme('DE00 2105 0170 0012 3456 78')
..> '68'
Werner
--
Liste abmelden mit E-Mail an: users+unsubscribe@de.libreoffice.org
Probleme? http://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: http://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: http://listarchives.libreoffice.org/de/users/
Alle E-Mails an diese Liste werden unlöschbar öffentlich archiviert
Context
- Re: [de-users] Prüfziffern IBAN berechnen (continued)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.