Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

Get the juciest casino bonuses at this great website

If you are looking for great entertainment online, then we would like to recommend CasinoAdvisers.com. Find the best casino bonus available and much more that makes your casino experience much more enjoyable!

string_format

Posizione del Parametro Tipo Obbligatorio Default Descrizione
1 stringa nessuno E' il formato da usare. (sprintf)

Questo è un modo di formattare stringhe, ad esempio per i numeri decimali e altro. Utilizzare la sintassi della funzione PHP sprintf().

Example 5.17. string_format


<?php

$smarty = new Smarty;
$smarty->assign('number', 23.5787446);
$smarty->display('index.tpl');

?>

   

Dove index.tpl è:


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

   

Questo stamperà:


23.5787446
23.58
24

   

Comments
No comments for this page.

Advertisement