numericType
The numeric type of the scalar.
Declaration
var numericType: Unicode.NumericType? { get }Discussion
For scalars that represent a number, numericType is the numeric type of the scalar. For all other scalars, this property is nil.
let scalars: [Unicode.Scalar] = ["4", "④", "⅕", "X"]
for scalar in scalars {
print(scalar, "-->", scalar.properties.numericType)
}
// 4 --> Optional(Swift.Unicode.NumericType.decimal)
// ④ --> Optional(Swift.Unicode.NumericType.digit)
// ⅕ --> Optional(Swift.Unicode.NumericType.numeric)
// X --> nilThis property corresponds to the “Numeric_Type” property in the Unicode Standard.