빠르고 더러움, 그냥 thousandSeparator
및 decimalSeparator
으로 설정하십시오. 그것은 작동합니다 :
//Set these once, right after Ext.onReady
Ext.util.Format.thousandSeparator = '.';
Ext.util.Format.decimalSeparator = ',';
//Then this should work:
Ext.util.Format.number(12345.67, '0,000.00'); //output 12.345,67
또는 더 나은는 localization을 사용, 형식 언어 요구 사항에 따라 변경 될 수 있습니다.
사이드 노트 :
문서 작성 : (.)
이 형식 문자열의 사양을 추가, 국제 전화 번호에 대한 영국/미국 그룹화 문자 (,)와 소수점을 사용하여 허용하려면/끝까지. 예를 들어 : 0.000,00/
그리고 나에 source code
// The "/i" suffix allows caller to use a locale-specific formatting string.
// Clean the format string by removing all but numerals and the decimal separator.
// Then split the format string into pre and post decimal segments according to *what* the
// decimal separator is. If they are specifying "/i", they are using the local convention in the format string.
의 주석에서 나는, 개발자가 특정 형식의 문자열 "0.000,00"를 사용할 수 있다는 것을 의미 것으로 보인다 주어진 수의 서식을 지정하고 은이 아니므로 개발자는이 특정 서식 문자열을 사용하여 숫자를 원하는 서식으로 서식 지정할 수 있음을 의미합니다. 기본 구분자 설정을 변경해야합니다.
편집
데모 링크 : http://jsfiddle.net/chaoszcat/nbWwN/
을 설정하십시오. 1000Separator 및 decimalSeparator가 이미 시도되었지만 결과가 없습니다. 현지화를 시도합니다! – Jom
왜 작동하지 않습니까? 작동 중입니다. http://jsfiddle.net/chaoszcat/nbWwN/ –
방금 질문을 다시 읽었습니다. 그룹화를 위해 단 하나의 "도트"만 갖고 싶다는 뜻입니까? "12345475.394,49"? –