Decimal

Format

decimal ( expression )
decimal expression

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/3

affichera

0.666667
0.6666666667
0.666666666666667

Voir aussi

Disponible à partir de la version

0.9.6w

 
fr/decimal.txt · Last modified: 2010/10/21 10:09 by gaelle
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki