objToNumber function

Number objToNumber(
  1. Object object
)

Converts an object to a Number. The object must be either a num or Number, otherwise an Exception is thrown.

Implementation

Number objToNumber(Object object) {
  if (object is num) return numToNumber(object);
  if (object is Number) return object;
  throw Exception('num or Number expected');
}