어떤 언어든지 NumberFormatter이 있거나 또는 Formatter이 있지만,

Flex에서는 아주 쉽게 천단위에 컴마( , ) 를 찍을수 있습니다.

ActionScript를 이용하는 방법입니다.

private function test() : void
{
var numberFormatter:NumberFormatter = new NumberFormatter();
numberFormatter.useThousandsSeparator = true;

//numberFormatter.format(value:Object):String
trace( numberFormatter.format( 10000000 ) );

}



numberFormatter.format( value:Object ):String 처럼 format() 라는 속성을 이용하시면 쉽게

천단위에 컴마를 찍을수 있습니다. 데이터가 String형이든 Integer 또는  Number이던 상관이 없습니다.

value를 Object형으로 받아서 String형으로 리턴 해주기 때문이죠 ^^

-- 태클 또는 추가 , 트랙백 언제나 환영입니다 ^^ --
크리에이티브 커먼즈 라이센스
Creative Commons License
2010/04/13 10:15 2010/04/13 10:15

이 글의 트랙백 주소 - http://www.blanknote.kr/trackback/10

  1. Blank [2010/05/13 17:16]  수정/삭제 |  댓글쓰기

    아무도 댓글 안달아줌 ㅠ

  2. 마빡이 [2011/05/30 09:56]  수정/삭제 |  댓글쓰기

    관심

이름     비밀번호     홈페이지 또는 블로그

블로그 이미지

+_+/ Blank Your M.i.n.d_ -Blank