jherbaux Posted December 30, 2009 Share Posted December 30, 2009 Bonjour, Je voudrais savoir comment limiter le nombre de chiffre après la virgule dans un fichier tpl?Je m'explique...Après un calcul je me retrouve avec un prix égal à 30.1392€Vous en conviendrai que c'est pas terrible donc je voudrai arrondir ce chiffre.Merci de votre aide Link to comment Share on other sites More sharing options...
mks Posted December 30, 2009 Share Posted December 30, 2009 Tu as essayé avec l'opérande Round...?{$variable|round}Après il suffit juste de spécifier le nombre de décimales voulues. Link to comment Share on other sites More sharing options...
jherbaux Posted December 30, 2009 Author Share Posted December 30, 2009 merci, je lui est mis :2 derrière pour avoir mes 2 chiffres après la virgule,Sa marche!encore merci Link to comment Share on other sites More sharing options...
Jean-Bruno Posted May 4, 2010 Share Posted May 4, 2010 Salut et merci d'avancequelqun saurait me montrer la syntaxe {if $product.reduction} {$product.price_without_reduction}{$variable|round:2} {/if} c'est correct ? Link to comment Share on other sites More sharing options...
mks Posted May 4, 2010 Share Posted May 4, 2010 Bonjour,Voici la syntaxe dans votre cas: {if $product.reduction} {$product.price_without_reduction|round:2} {/if} Link to comment Share on other sites More sharing options...
Jean-Bruno Posted May 4, 2010 Share Posted May 4, 2010 Mille merci MKS ça fonctionne déja beaucoup mieux !toutefois il ne "force" pas l'affichage à 2 chiffres après la virgule. Du genre 56.00Voilà ce que ça donne Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now