String (@NonNls String text) { final boolean isHexadecimal = text.startsWith("0x") || text.startsWith("0X"); int breakPoint = text.indexOf('e'); if (breakPoint < 0) { breakPoint = text.indexOf('E'); } if (breakPoint < 0) { breakPoint = text.indexOf('f'); } if (breakPoint < 0) { breakPoint = text.indexOf('F'); } if (breakPoint < 0) { breakPoint = text.indexOf('p'); } if (breakPoint < 0) { breakPoint = text.indexOf('P'); } if (breakPoint < 0) { breakPoint = text.indexOf('d'); } if (breakPoint < 0) { breakPoint = text.indexOf('D'); } final String suffix; final String prefix; if (breakPoint < 0) { suffix = ""; prefix = text; } else { suffix = text.substring(breakPoint); prefix = text.substring(0, breakPoint); } final int indexPoint = prefix.indexOf('.'); if (indexPoint < 0) { return prefix + ".0" + suffix; } else if (isHexadecimal && indexPoint == 2) { return prefix.substring(0, 2) + '0' + prefix.substring(2) + suffix; } else if (indexPoint == 0) { return '0' + prefix + suffix; } else { return prefix + '0' + suffix; } }