Jak wyświetlić liczbę po przecinku w smarty: Różnice pomiędzy wersjami

Z Podręcznik Administratora by OPZ SGU
Przejdź do nawigacji Przejdź do wyszukiwania
(Utworzył nową stronę „string_format <pre> <?php $smarty->assign('number', 23.5787446); ?> </pre> Where template is: <pre> {$number} {$number|string_format:"%.2f"} {$number|string_form...”)
(Brak różnic)

Wersja z 19:23, 29 lut 2012

string_format


<?php
$smarty->assign('number', 23.5787446);
?>

Where template is:

{$number}
{$number|string_format:"%.2f"}
{$number|string_format:"%d"}

Will output:

23.5787446
23.58
24