Nikhil_K_R
Nikhil_K_R

Reputation: 2373

Magento insert decimal value in database

I have one custom module.
There is one field which is decimal number.
But on saving it doesn't store decimal value.
Like saving : 1.23 after_saving : 1.00
When I add the value from phpmyadmin it gets added and the same value is retreived and after that if the data is saved it again repeats :- saving : 1.23 after_saving : 1.00
Please help .

Upvotes: 0

Views: 830

Answers (1)

Nikhil_K_R
Nikhil_K_R

Reputation: 2373

Thanks to @yogus for giving hint.

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php

So in controller SaveAction()

have added

$data['sorter'] = number_format($data['sorter'], 2, null, '');

$data['sorter'] --> This is value coming in post.

Upvotes: 1

Related Questions