Cast integer. Integer values are indicated in the standard way for any valid integer.
types.castInteger(format, value, options = { })
format | no options (other than the default) |
---|---|
value | integer to cast |
options | named list set bareNumber |
bareNumber is a boolean field with a default of TRUE
. If TRUE
the physical contents of this field must follow
the formatting constraints already set out. If FALSE
the contents of this field may contain leading
and or trailing non-numeric characters (which implementors MUST therefore strip).
The purpose of bareNumber
is to allow publishers to publish numeric data that contains trailing characters such as percentages
e.g. 95
if anything, they do with stripped text.
types.castInteger(format = "default", value = 1)#> [1] 1types.castInteger(format = "default", value = "1")#> [1] 1# cast trailing non numeric character types.castInteger(format = "default", value = "1$", options = list(bareNumber = FALSE))#> [1] 1