웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
심플한 원단위를 콤마로 나타내주기
2003.11.11 22:11
홈페이지 가지신분들은 많이 놀러오세요.
http://www.zentoo.com
function setComma(str)
{
str = ""+str+"";
var retValue = "";
for(i=0; i<str.length; i++)
{
if(i > 0 && (i%3)==0) {
retValue = str.charAt(str.length - i -1) + "," + retValue;
} else {
retValue = str.charAt(str.length - i -1) + retValue;
}
}
return retValue +"원";
}
쓰는 방법은 setComma(3000);
이렇게 쓰세요.
http://www.zentoo.com
function setComma(str)
{
str = ""+str+"";
var retValue = "";
for(i=0; i<str.length; i++)
{
if(i > 0 && (i%3)==0) {
retValue = str.charAt(str.length - i -1) + "," + retValue;
} else {
retValue = str.charAt(str.length - i -1) + retValue;
}
}
return retValue +"원";
}
쓰는 방법은 setComma(3000);
이렇게 쓰세요.
댓글 2
-
정념, 정행
2003.11.12 10:31
-
한꼬마
2003.11.14 03:58
정념 //
자바스크립트 입니다. 말씀하신것은 php 입니다.
제목 | 글쓴이 | 날짜 |
---|---|---|
응용편 - BMI 측정 테스트 소스를 만들어보자 [5] | 티다 | 2004.06.04 |
게시판내용에 코멘트를 달자!! -마지막- [2] | 이혁 | 2004.06.03 |
게시판내용에 코멘트를 달자!! -2- [1] | 헉스 | 2004.06.02 |
게시판내용에 코멘트를 달자!! [3] | 헉스 | 2004.06.02 |
2. array [5] | 티다 | 2004.06.02 |
1. 연산자 [2] | 티다 | 2004.06.02 |
주식정보출력코드 [2] | 김재경 | 2004.06.01 |
윈도우계정에서 현재 남은 용량과 DB 용량 알기 [6] | 지으니 | 2004.05.31 |
초간단 스팸방지 하면서 곧바로 메일 보내기 [3] | U2em | 2004.05.31 |
해당 ftp 파일 서버에서 다른곳의 ftp 파일 서버로 백업용도 및 전송하기.. [9] | 김동욱 | 2004.05.30 |
초간단 설문조사 소스 [3] | 이혁 | 2004.05.27 |
PHP로 구현하는 음악 감상실 [9] | 컴도미 | 2004.05.21 |
[국밥PHP] 1-1(1). 개념정리 Break Time (Build 1) [7] | 9000㎒ | 2004.05.18 |
팁 아닌 팁 한달전... | http://zentoo.com | 2004.05.15 |
포털사이트 처럼 시스템 점검중 만들기 [3] | http://zentoo.com | 2004.05.14 |
PHP 4에서 PHP 5로 이행 [5] | 이종현 | 2004.04.30 |
PHP5 RC2 Released. [4] | 써니루루☆ | 2004.04.27 |
트랙백 구현하기 - 2. 트랙백의 형식 | TheMics | 2004.04.22 |
트랙백 구현하기 - 2. 트랙백의 형식 | TheMics | 2004.04.22 |
엔지오 채널 따라하기 -_-& www자동 붙이기 [6] | 박종찬 | 2004.04.18 |
하고 무슨 차이가 있지요?
혹시나 해서 질문 드립니다.