Difference between revisions of "FormatISBN13"

From Sega Retro

Line 6: Line 6:
 
{{#vardefine:isbn13region|{{#sub:{{#var:isbn13raw}}|3|1}}}}
 
{{#vardefine:isbn13region|{{#sub:{{#var:isbn13raw}}|3|1}}}}
 
{{#ifexpr:{{#var:isbn13region}} > 4 and {{#var:isbn13region}} != 7
 
{{#ifexpr:{{#var:isbn13region}} > 4 and {{#var:isbn13region}} != 7
|{{#vardefine:isbn13region|{{#sub:{{#var:isbn13raw}}|3|2}}}}{{#vardefine:isbn13etc|{{#sub:{{#var:isbn13raw}}|5|7}}}}[[Category:ISBN-13 is probably wrong]]
+
|{{#vardefine:isbn13region|{{#sub:{{#var:isbn13raw}}|3|2}}}}{{#vardefine:isbn13etc|{{#sub:{{#var:isbn13raw}}|5|7}}}}{{#ifexpr:{{#var:isbn13region}} != 65 and ({{#var:isbn13region}} < 80 or {{#var:isbn13region}} > 94)|[[Category:ISBN-13 is probably wrong]]|}}
 
|{{#vardefine:isbn13etc|{{#sub:{{#var:isbn13raw}}|4|8}}}}
 
|{{#vardefine:isbn13etc|{{#sub:{{#var:isbn13raw}}|4|8}}}}
 
}}
 
}}

Revision as of 05:05, 2 May 2019


Template for formatting ISBN-13 numbers. Hypens and spaces are stripped out at the start.


The format for ISBN-13 is

[978/979]-[region]-[publisher]-[title]-[checkdigit]

the region is a fixed length (depending on where it came from), but the publisher and title fields can be any length, so they're currently grouped together.

Examples

{{FormatISBN13|978-4073055501|link=yes}}



Expression error: Unexpected > operator.


978----01


{{FormatISBN13|9785073 055501}}


978-50-73 0555-01