number_formatSyntaxenomber_format(n, x) Ajuste un nombre entier n au format x en ajoutant le nombre de zéro nécessaires. Les paramètres sont au format nombre, le résultat est au format texte. Par L.Sebilleau Exemplenumber_format(123, 5) ---> "00123" Scripton number_format(n, x) set n to n as string repeat while the (count of n) < x set n to "0" & n as string end repeat return n end number_format
RemarqueRoutine analogue à "Adding Leading Zeros" (AppleScript Guidebook) mais beaucoup plus concise.
|