Jump to content

Module shows bunch of decimals


Recommended Posts

Hello everybody, I have a module that shows a percentage of the remaining products in stock, the thing is it shows a lot of decimals and I don't want to show this, I only want to display the whole number, here is part of the module code


{if $valuepercen<100}<div class="weempty"><span class="percent">{*{$item}*}{100-$valuepercen}% </span><span class="restante">{l s='STOCK RESTANTE' mod='soldcountdown'}</span></div>{/if}
Edited by redoli (see edit history)
Link to comment
Share on other sites

Hello Bellini, thank you so much for your reply, I have looking for smarty function and I used this one |number_format:0 and it worked!

Here is the code modified, maybe it is usefull to somebody:

{if $valuepercen<100}<div class="weempty"><span class="percent">{*{$item}*}{100-$valuepercen|number_format:0}% </span><span class="restante">{l s='STOCK RESTANTE' mod='soldcountdown'}</span></div>{/if}

Link to comment
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...