Formater un entier en PHP
Résolu
.Zoro.
Messages postés
285
Statut
Membre
-
.Zoro. Messages postés 285 Statut Membre -
.Zoro. Messages postés 285 Statut Membre -
Bonjour,
est-ce que quelqu'un sait comment manipuler les entiers (ou les float aussi)
de maniere a forcer leurs affichage sur 2 chifres
1 => 01
5 => 05
11 => 11
merci
est-ce que quelqu'un sait comment manipuler les entiers (ou les float aussi)
de maniere a forcer leurs affichage sur 2 chifres
1 => 01
5 => 05
11 => 11
merci
A voir également:
- Formater un entier en PHP
- Comment formater un pc - Guide
- Formater clé usb - Guide
- Formater un pc bloqué par administrateur - Guide
- Easy php - Télécharger - Divers Web & Internet
- Comment formater un iphone - Guide
2 réponses
Regarde ici
https://www.php.net/manual/fr/function.sprintf.php
exemples
Gates gave ^H sold you the windows.
GNU gave us the whole house.(Alexandrin)
https://www.php.net/manual/fr/function.sprintf.php
exemples
johand@osiris:~/public_html$ cat format.php
<?php
printf("Entier: %03d\n", 17);
printf("Flottant: %08.3f\n", 3.1415926);
?>
johand@osiris:~/public_html$ php format.php
Entier: 017
Flottant: 0003.142
Gates gave ^H sold you the windows.
GNU gave us the whole house.(Alexandrin)