This shows you the differences between two versions of the page.
fr:decimal [2016/01/01 22:44] |
fr:decimal [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Decimal ===== | ||
+ | ==== Format ==== | ||
+ | |||
+ | **decimal** ( // | ||
+ | **decimal** // | ||
+ | |||
+ | ==== Description ==== | ||
+ | |||
+ | Définie le nombre maximal de décimales (0-16) à convertir quand un nombre à virgule flottante est transformé en chaîne de caractères. | ||
+ | Cela ne change pas la précision interne des calculs numériques mais seulement la manière dont ils sont affichés ou enregistrés comme chaîne. | ||
+ | Par défaut, 6 chiffres après la virgule seront affichés. | ||
+ | |||
+ | ==== Exemple ==== | ||
+ | |||
+ | < | ||
+ | print 2/3 | ||
+ | decimal 10 | ||
+ | print 2/3 | ||
+ | decimal 15 | ||
+ | print 2/ | ||
+ | affichera | ||
+ | < | ||
+ | 0.666667 | ||
+ | 0.6666666667 | ||
+ | 0.666666666666667 | ||
+ | </ | ||
+ | |||
+ | ==== Voir aussi ==== | ||
+ | [[print|Print]], | ||
+ | |||
+ | ==== Disponible à partir de la version ==== | ||
+ | 0.9.6w |