Jump to content
  • 0

ISBN controle


dirk

Question

2 answers to this question

Recommended Posts

  • 0
Posted

Hier een controle voor de officiele ISBN 10 (dus geen rekeninghoudende met de soms eigen afwijkende ISBN cijfers meestal eindigend op XX)

 

// ISBN 10
Let
(
[
ISBN ="90-270-1165-6"
;
filterisbn=Filter(ISBN;"0123456789") // Behoud alleen cijfers
;
Controlecijfer = if(length(filterisbn) ? 10 ; GetAsNumber("") ; GetAsNumber(right(filterisbn;1) ) )
;
SumCheck = (Middle (filterisbn ; 1; 1) * 10) + (Middle (filterisbn ; 2; 1) * 9) + (Middle (filterisbn ; 3; 1) *  + (Middle (filterisbn ; 4; 1) * 7) + (Middle (filterisbn ; 5; 1) * 6) + (Middle (filterisbn ; 6; 1) * 5) + (Middle (filterisbn ; 7; 1) * 4) + (Middle (filterisbn ; 8; 1) * 3) + (Middle (filterisbn ; 9; 1) * 2) 
;
CheckControlecijfer =  (Ceiling(Sumcheck/11) * 11)- SumCheck
;
result = If(Not Isempty(ControleCijfer) and Controlecijfer=CheckControlecijfer; "OK" ; "Niet OK")
]
;
result
)

 

 

ISBN 13 kun je volgende formule gebruiken:

// ISBN 13
Let
(
[
ISBN =" 978-90-77287-02-6"
;
filterisbn=Filter(ISBN;"0123456789") // Behoud alleen cijfers
;
Controlecijfer = if(length(filterisbn) ? 13 ; GetAsNumber("") ; GetAsNumber(right(filterisbn;1) ) )
;
SumCheckOneven = Middle (filterisbn ; 1; 1)  + Middle (filterisbn ; 3; 1)   + Middle (filterisbn ; 5; 1) + Middle (filterisbn ; 7; 1) + Middle (filterisbn ; 9; 1)  + Middle (filterisbn ; 11; 1) 
;
SumCheckEven = Middle (filterisbn ; 2; 1)  + Middle (filterisbn ; 4; 1)   + Middle (filterisbn ; 6; 1) + Middle (filterisbn ; 8; 1) + Middle (filterisbn ; 10; 1)  + Middle (filterisbn ; 12; 1) 
;
CheckControlecijferCalc = 10 - Right(SumCheckOneven + (SumCheckEven *3);1)
;
CheckControlecijfer = If(CheckControlecijferCalc=10;0;CheckControlecijferCalc)
;
result = If(Not Isempty(ControleCijfer) and Controlecijfer=CheckControlecijfer; "OK" ; "Niet OK")
]
;
result
)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...