Alexandre Carette Posted March 7, 2016 Share Posted March 7, 2016 Bonjour, Je dois afficher un prix en hors taxe, j'utilise math pour faire mon petit calcul: {math equation='a/1.2' a=$prices.$ipa assign='total_without_taxes'} <strong>{$total_without_taxes}€ HT</strong> j'obtiens: 4.533 si j'utilise round <strong> {$total_without_taxes|round:'2'}€ HT </strong> j'obtiens: 4.53 j'ai besoin d'obtenir un arrondi au dixième supérieur: 4.54, j'ai regardé la doc smarty + php mais je galère un peu.... Est ce que quelqu'un aurait la gentillesse de m'aider... Merrci Link to comment Share on other sites More sharing options...
coeos.pro Posted March 7, 2016 Share Posted March 7, 2016 (edited) et avec ceil ? {math equation='ceil(a/1.2*100)/100' a=$prices.$ipa assign='total_without_taxes'} {$total_without_taxes} affichera directement 4.54 Edited March 7, 2016 by coeos.pro (see edit history) 1 Link to comment Share on other sites More sharing options...
Alexandre Carette Posted March 7, 2016 Author Share Posted March 7, 2016 (edited) <strong> {$total_without_taxes|ceil}€ HT </strong> Ca me donne: 5 et {$total_without_taxes} me donne: 4.5333333333333 Pardon j'ai mal lu equation='ceil(a/1.2*100)/100' Ah yes ! ca marche merci Coeos pro Edited March 7, 2016 by Alex-Kodd (see edit history) 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