added toInt cast function

should be ((Number) value).intValue()