aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/javascript/reference/global_objects/object/tolocalestring/index.md
diff options
context:
space:
mode:
authorjulieng <julien.gattelier@gmail.com>2021-08-03 08:03:09 +0200
committerSphinxKnight <SphinxKnight@users.noreply.github.com>2021-09-03 08:08:25 +0200
commit844f5103992238c0c23203286dad16a466e89c97 (patch)
treed537708951bb2b61be8192ffacc05a0ce6804f89 /files/fr/web/javascript/reference/global_objects/object/tolocalestring/index.md
parenta70fd5b73ecb10bec3906640023e2a1a46e118a2 (diff)
downloadtranslated-content-844f5103992238c0c23203286dad16a466e89c97.tar.gz
translated-content-844f5103992238c0c23203286dad16a466e89c97.tar.bz2
translated-content-844f5103992238c0c23203286dad16a466e89c97.zip
move *.html to *.md
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/object/tolocalestring/index.md')
-rw-r--r--files/fr/web/javascript/reference/global_objects/object/tolocalestring/index.md82
1 files changed, 82 insertions, 0 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/object/tolocalestring/index.md b/files/fr/web/javascript/reference/global_objects/object/tolocalestring/index.md
new file mode 100644
index 0000000000..331b91a04f
--- /dev/null
+++ b/files/fr/web/javascript/reference/global_objects/object/tolocalestring/index.md
@@ -0,0 +1,82 @@
+---
+title: Object.prototype.toLocaleString()
+slug: Web/JavaScript/Reference/Global_Objects/Object/toLocaleString
+tags:
+ - JavaScript
+ - Méthode
+ - Prototype
+ - Reference
+translation_of: Web/JavaScript/Reference/Global_Objects/Object/toLocaleString
+original_slug: Web/JavaScript/Reference/Objets_globaux/Object/toLocaleString
+---
+<div>{{JSRef}}</div>
+
+<p>La méthode <code><strong>toLocaleString()</strong></code> renvoie une chaine de caractères représentant l'objet. Cette méthode est destinée à être surchargée par les objets dérivés à des fins spécifiques pour prendre en compte les locales.</p>
+
+<div>{{EmbedInteractiveExample("pages/js/object-prototype-tolocalestring.html")}}</div>
+
+<h2 id="Syntaxe">Syntaxe</h2>
+
+<pre class="syntaxbox"><var>obj</var>.toLocaleString()</pre>
+
+<h3 id="Valeur_de_retour">Valeur de retour</h3>
+
+<p>Une chaîne de caractères qui représente l'objet en tenant compte de la locale.</p>
+
+<h2 id="Description">Description</h2>
+
+<p>La méthode <code>toLocaleString</code> renvoie le résultat de l'appel à la méthode {{jsxref("Object.toString", "toString()")}}.</p>
+
+<p>Cette fonction est destinée à fournir aux objets une méthode générique <code>toLocaleString</code>, même si tous ne peuvent l'utiliser. Voir la liste ci-dessous.</p>
+
+<h3 id="Objets_surchargeant_la_méthode_toLocaleString">Objets surchargeant la méthode toLocaleString</h3>
+
+<ul>
+ <li>{{jsxref("Array")}} : {{jsxref("Array.prototype.toLocaleString()")}}</li>
+ <li>{{jsxref("Number")}} : {{jsxref("Number.prototype.toLocaleString()")}}</li>
+ <li>{{jsxref("Date")}} : {{jsxref("Date.prototype.toLocaleString()")}}</li>
+</ul>
+
+<h2 id="Spécifications">Spécifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Spécification</th>
+ <th scope="col">État</th>
+ <th scope="col">Commentaires</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('ES3')}}</td>
+ <td>{{Spec2('ES3')}}</td>
+ <td>Définition initiale.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES5.1', '#sec-15.2.4.3', 'Object.prototype.toLocaleString')}}</td>
+ <td>{{Spec2('ES5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-object.prototype.tolocalestring', 'Object.prototype.toLocaleString')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-object.prototype.tolocalestring', 'Object.prototype.toLocaleString')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
+
+<p>{{Compat("javascript.builtins.Object.toLocaleString")}}</p>
+
+<h2 id="Voir_aussi">Voir aussi</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.toString()")}}</li>
+</ul>