The
num
element represents a set of Arabic or Roman numerals that taken together indicate a single value or represent a single number
in a standardized format.
Examples of numbers include: cardinal and ordinal values, weights, measures, currency values, postal codes, telephone numbers,
ISBN numbers, scores and results, etc. Where these values include units of measure or other symbols integral to their understanding,
the units and symbols must be included as a part of the
num
element.
The
role
attribute optionally expresses the semantic nature of the number. If omitted, the implicit value
cardinal
is assumed.
If the value of the
num
element is not in a machine-readable format, the
value (num)
attribute optionally allows the inclusion of an alternate representation.
The MathML feature is intended for marking proper mathematical statements within documents and should be used in preference
over the
num
element whenever equations, formulae or other formal mathematic constructs or operators are being marked.
The
num
element must not be used to mark instances of dates and times. Refer to the
time
element for more information.
Usage details available in the Usage Details section.
Usage Example
At this rate, on the above data, the denudation of the Weald must have
required <num>306,662,400</num> years; or say
<num value="300,000,000">three hundred million</num> years.
Allowed parents
address,
annoref,
annotation (block variant),
annotation (phrase variant),
m:annotation-xml,
aside (block variant),
aside (toc variant),
block,
caption,
citation (block variant),
citation (phrase variant),
d,
definition,
description (block variant),
description (phrase variant),
emph,
entry (toc variant),
entry (index variant),
entry (bibliography variant),
entry (glossary variant),
expansion,
xforms:group,
h,
hd,
hpart,
item,
xforms:label,
ln,
d:longdesc,
meta,
note (block variant),
note (phrase variant),
noteref,
object (block variant),
object (phrase variant),
sel:otherwise,
p,
ssml:phoneme,
ssml:prosody,
quote (block variant),
quote (phrase variant),
its:rb,
ref,
xforms:repeat,
its:rt,
s,
ssml:say-as (phrase variant),
ssml:say-as (text variant),
d:simplifiedLanguageDescription,
span,
spine,
ssml:sub,
d:summary,
td,
term,
th,
d:tour and
sel:when
Allowed children
This element may contain text.
This element may contain the following children: ssml:break,
char,
emph,
object,
pagebreak,
ssml:phoneme,
ssml:prosody,
its:ruby,
ssml:say-as,
span,
sub,
ssml:sub,
sup and
ssml:token
Content model and additional requirements
optional attributes:
@about,
@by,
@class,
@content,
@datatype,
@desc,
@its:dir,
@its:translate,
@property,
@rel,
@resource,
@rev,
@role,
@sel:selid,
@ssml:onlangfailure,
@typeof,
@value,
@xml:base,
@xml:id,
@xml:lang and
@xml:space
one or more of
a choice of either one of the 14 elements:
char,
emph,
its:ruby,
object,
pagebreak,
span,
ssml:break,
ssml:phoneme,
ssml:prosody,
ssml:say-as,
ssml:sub,
ssml:token,
sub or
sup
or text
end of choice
Note that in addition to restrictions presented in the content model above,
use of this element must also respect the following requirement:
- The
num
element must neither be empty nor contain only whitespace.
Such requirements take precedence over any conflicting statements in the
content model or in the lists above of allowed children and parents.
Namespace
http://www.daisy.org/ns/z3998/authoring/
Usage Details
Following are examples of how the
num
element can be used to format identifiers and numbers that are not used in mathemtatical contexts:
-
Cardinal Numbers
<num role="cardinal" value="30,000">30.000</num> lightyears away.
-
Ordinal Numbers
The <num role="ordinal">1st</num> person on the moon was Neil Armstrong.
-
Roman Numerals
The motion picture release date is listed as <num role="roman" value="1948">mcmxlviii</num>.
-
Phone Numbers
The conference call in line was <num role="phone">+1 416-486-2500</num>
-
ISBN numbers
Lib. Binding: <num role="isbn">978-1-1234-4567-1</num>
-
Postal Code
There is, in fact, no <num role="postal">90210</num> zip code in the United States.
-
Currencies
The US dollar is currently trading at <num role="currency">€0.731768</num> and <num role="currency">$1.02CAD</num>.
-
Heights
The tallest man ever was <num role="height">8'11.1"</num> or <num role="height">272 cm</num>.
-
Weights
He weighed in at slightly over <num role="weight">220 lbs</num> for the fight.
-
Percentages
Only <num role="percentage">15%</num> of people know that statistics are misleading.
-
Ratios
The ratio of gas to oil is <num role="ratio">3:2</num> for the lawn mower to work without sputtering.
-
Coordinates
The Great Pyramid of Giza is located at <num role="coordinate">29°58′45.03″N</num> <num role="coordinate">31°08′03.69″E</num>.
-
Fractions
Add <num role="fraction">1/2</num> cup of milk.
-
Mixed
Add <num role="mixed">2 3/4</num> cups of flour.
-
Decimal
Pi is often rounded to <num role="decimal">3.14</num> when used in equations.
-
Segmented
He made the dubious claim that his Social Insurance Number is <num role="segmented">000 000 001</num>.
The
span
element can further be used to group related sets of numbers:
-
Ranges
It takes between <span role="range"><num>2</num>–<num>5</num></span> cups of flour depending on the size of the loaf.
-
Results
The final score was <span role="result"><num>3</num>-<num>2</num></span> for Team Canada over Team USA.