Difference between revisions of "FormatISBN10"
From Sega Retro
Line 4: | Line 4: | ||
{{#vardefine:isbn10region|{{#sub:{{#var:isbn10raw}}|0|1}}}} | {{#vardefine:isbn10region|{{#sub:{{#var:isbn10raw}}|0|1}}}} | ||
{{#ifexpr:{{#var:isbn10region}} > 4 and {{#var:isbn10region}} != 7 | {{#ifexpr:{{#var:isbn10region}} > 4 and {{#var:isbn10region}} != 7 | ||
− | |{{#vardefine:isbn10region|{{#sub:{{#var:isbn10raw}}|0|2}}}}{{#vardefine: | + | |{{#vardefine:isbn10region|{{#sub:{{#var:isbn10raw}}|0|2}}}}{{#vardefine:isbn10etc|{{#sub:{{#var:isbn10raw}}|2|7}}}}[[Category:ISBN-10 is probably wrong]] |
− | |{{#vardefine: | + | |{{#vardefine:isbn10etc|{{#sub:{{#var:isbn10raw}}|1|8}}}} |
}} | }} | ||
− | {{#vardefine: | + | {{#vardefine:isbn10checkdigit|{{#sub:{{#var:isbn10raw}}|9}}}} |
− | {{#vardefine:isbn10|{{#var:isbn10region}}-{{#var: | + | {{#vardefine:isbn10|{{#var:isbn10region}}-{{#var:isbn10etc}}-{{#var:isbn10checkdigit}}}} |
− | </div>{{#ifeq:{{{link|}}}|yes|[http://www.worldcat.org/isbn/{{#var:isbn10}} {{#var:isbn10}}]|{{#var:isbn10}}}}|}}</includeonly><noinclude> | + | </div>{{#ifeq:{{{link|}}}|yes|[http://www.worldcat.org/isbn/{{#var:isbn10}} {{#var:isbn10}}]|{{#var:isbn10}}}}|}}{{#vardefine:isbn10|}}{{#vardefine:isbn10raw|}}{{#vardefine:isbn10region|}}{{#vardefine:isbn10etc|}}{{#vardefine:isbn10checkdigit|}}</includeonly><noinclude> |
Template for formatting ISBN-10 numbers. Hypens and spaces are stripped out at the start. | Template for formatting ISBN-10 numbers. Hypens and spaces are stripped out at the start. |
Revision as of 05:52, 2 May 2019
Template for formatting ISBN-10 numbers. Hypens and spaces are stripped out at the start.
The format for ISBN-10 is
[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
{{FormatISBN10|4073055501|link=yes}}
{{FormatISBN10|5073 055501}}
50-73 0555-01