<%! /*---------------------------------------------------- ±ÛÀÚ ±æÀÌ°¡ ±æ¶§ ¿øÇÏ´Â ±æÀ̸¸Å­ ÀÚ¸¥ÈÄ '..' ºÙÈû. ----------------------------------------------------*/ public String cutoffString(String str, int len) { String str1 = ""; char[] ch = str.toCharArray(); int str_len = 0; for ( int i=0; i len) { str1 = str1 + "..."; } return str1; } /*---------------------------------------------------- ¹®ÀÚ¿­ ´ëü ----------------------------------------------------*/ public String replace(String stro, String s1, String s2) { int i = 0; String rStr = ""; while( stro.indexOf(s1) > -1 ) { i = stro.indexOf(s1); rStr += stro.substring(0,i)+s2; stro = stro.substring(i+s1.length()); } return rStr+stro; } public String getStringWon (String numerator) { String returnVal=""; String temp_str = numerator; String minors = ""; temp_str = replace(temp_str,",",""); if (temp_str.indexOf ("-") != -1 ) { minors = "Y"; temp_str = replace(temp_str,"-",""); } else { minors = "N"; } if(temp_str.length() <= 3) { if (minors.equals("Y")) { return returnVal = "-" + temp_str; } else { return returnVal = temp_str; } } while (true) { returnVal = ","+temp_str.substring(temp_str.length()-3,temp_str.length())+returnVal; temp_str = temp_str.substring(0,temp_str.length()-3); if (temp_str.length() <=3) { returnVal = temp_str + returnVal; break; } } if (minors.equals("Y")) { returnVal = "-" + returnVal; } return returnVal; } public String toParamStr(String oldStr, String newStr) { try { if (oldStr == null || oldStr.equals("")) { return newStr; } else { return oldStr.trim(); } } catch (Exception e) { return oldStr; } } %>