var.isNumeric

bool isNumeric() @property const nothrow @nogc pure @safe

Check if this value is a numeric type.

Numeric types include: BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, FLOAT, DOUBLE, REAL.

Returns

true if the value is numeric, false otherwise.

Examples

var i = 42;
assert(i.isNumeric);
var d = 3.14;
assert(d.isNumeric);
var s = "hello";
assert(!s.isNumeric);