Combine getInteger and getFloat into a single method getNumber.