I'm trying to set a decimal value to a percentage discount on a tierprice.

The problem is that when it's saved the value is becoming an int instead of a decimal.

Example if I set a percentage to 1.23% after save => 1%

enter image description here

after saving it

enter image description here

Any way that it keeps the decimal value ?


  • one quick way of doing it is *100 on save/post and /100 display, but I did it on a very particular situation that I can't remember now ... I'll look further later today – medmek Nov 15 '19 at 16:39
  • see example of number_format() in use : vendor/magento/module-currency-symbol/Block/Adminhtml/System/Currency/Rate/Matrix.php:112 – medmek Nov 15 '19 at 16:49

Your Answer

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

Browse other questions tagged or ask your own question.