kartik-v / yii2-money

An advanced money mask input for Yii 2.0 styled for Bootstrap 3
http://demos.krajee.com/money
Other
27 stars 21 forks source link

decimal as comma does not work #10

Closed chrisschd closed 7 years ago

chrisschd commented 9 years ago

Hello, First: great extention, thanks!

So if I use the widget with comma es decimal point it doesn't work. I've used the new version (5days ago) from the plentz/jquery-maskmoney repository but it doen's fix the issue.

$form->field($model, 'discount')->widget(MaskMoney::classname(), [ 'pluginOptions' => [ 'prefix' => '', 'suffix' => ' €', 'allowNegative' => false, 'thousands' => '.', 'decimal' => ',', 'precision' => 2, ] ]);

The value was't parsed correct. (new jquery file from plentz rep.): For Example: I've the value 2.1 in the model->discount then it shows "21,00€"

With the old jquery file: For Example: I've the value 2.1 in the model then it shows "0,02€" A work around was to manipulate the value with *100 to show the correct value, but then it saves 210 in the database when the field wasn't touched. (ok /100 will fixe them but ==>) If a manipulate the filed to for example 4,5 it will write the correct value 4.5 in the database ... How can I use the widget in a right way?

Thanks!

kartik-v commented 7 years ago

Resolved via updates & enhancements to release v1.2.2. Duplicate to #25, #11.