Jump to content

Recommended Posts

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

Share this post


Link to post
Share on other sites

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 by coeos.pro (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites
<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 by Alex-Kodd (see edit history)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More