This page was translated from English by the community.Learn more and join the MDN Web Docs community.
Object.prototype.toLocaleString()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.
toLocaleString() 메서드는 객체로 된 문자열을 반환합니다. 이 메서드는 지역별로 다른 객체로 재정의되어 표시됩니다.
In this article
시도해 보기
const date1 = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));console.log(date1.toLocaleString("ar-EG"));// Expected output: "٢٠/١٢/٢٠١٢ ٤:٠٠:٠٠ ص"const number1 = 123456.789;console.log(number1.toLocaleString("de-DE"));// Expected output: "123.456,789"구문
js
obj.toLocaleString();반환 값
객체를 나타내는 문자열.
설명
Object의toLocaleString은toString()을 호출 한 결과를 반환합니다.
이 함수는 모든 객체가 사용할 수는 없지만 객체에 일반toLocaleString 메소드를 제공하기 위해 제공됩니다. 아래 목록을 참조하십시오.
toLocaleString()을 재정의하는 객체
명세
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-object.prototype.tolocalestring> |