1

Question about the variable "promo_code_value". When rendered in the template, it gives 4 decimal points instead of none. So for example, I want to indicate that there's a 25% discount, so in the template I write:

{promo_code_value}%

But instead of "25%", it renders "25.0000%". Is there some way to change that? Have I done something wrong? Don't know maybe if there's a configuration setting somewhere.

Thanks!

2

You can use "Number Format" plugin (http://devot-ee.com/add-ons/number-format) and can use it like:

{exp:number_format number="{promo_code_value}"}%
1
  • Thanks Bhashkar. I also edited the db field directly -- the field 'value' is of type DECIMAL and set to '19,4'. I set it to '19,0' and it worked without the need for a plugin. – Sprocket House Jul 2 '13 at 3:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.