modified formatType.js