Difference between revisions of "FormatISBN10"
From Sega Retro
(terrifying) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{#if:{{{1|}}}|<div style="display:none;">{{#vardefine:isbn10raw|{{#replace:{{{1|}}}|-||}}}}{{#vardefine:isbn10raw|{{#replace:{{#var:isbn10raw}}| ||}}}} | + | <includeonly>{{#if:{{{1|}}}|{{#ifeq:{{{1}}}|none|N/A|<div style="display:none;">{{#vardefine:isbn10raw|{{#replace:{{#replace:{{{1|}}}|-||}}|<!--lrm-->|}}}}{{#vardefine:isbn10raw|{{#replace:{{#var:isbn10raw}}| ||}}}} |
{{#ifexpr:{{#len:{{#var:isbn10raw}}}} != 10|{{#ifeq:{{{link|}}}|yes|[[Category:Incorrect ISBN-10]]}}|}} | {{#ifexpr:{{#len:{{#var:isbn10raw}}}} != 10|{{#ifeq:{{{link|}}}|yes|[[Category:Incorrect ISBN-10]]}}|}} | ||
Line 10: | Line 10: | ||
{{#vardefine:isbn10|{{#var:isbn10region}}-{{#var:isbn10etc}}-{{#var:isbn10checkdigit}}}} | {{#vardefine:isbn10|{{#var:isbn10region}}-{{#var:isbn10etc}}-{{#var:isbn10checkdigit}}}} | ||
− | </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> | + | </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. | ||
Line 29: | Line 29: | ||
{{FormatISBN10|5073 055501}} | {{FormatISBN10|5073 055501}} | ||
− | [[Category: | + | [[Category:Templates]] |
</noinclude> | </noinclude> |
Latest revision as of 11:04, 12 September 2024
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