Kaynağa Gözat

[float formatting] [fix] take precision from global defaults

version-14
Anand Doshi 12 yıl önce
ebeveyn
işleme
66adf5fdff
2 değiştirilmiş dosya ile 10 ekleme ve 4 silme
  1. +9
    -3
      public/js/legacy/widgets/form/fields.js
  2. +1
    -1
      public/js/wn/form/formatters.js

+ 9
- 3
public/js/legacy/widgets/form/fields.js Dosyayı Görüntüle

@@ -894,10 +894,16 @@ FloatField.prototype.format_input = function() {
this.input.value='';
else {
var format;
if(this.get_field_currency)
if(this.get_field_currency) {
format = get_number_format(this.get_field_currency());
this.input.value =
format_number(parseFloat(this.input.value), format);
this.input.value =
format_number(parseFloat(this.input.value), format);
} else {
var decimals = wn.boot.sysdefaults.float_precision ?
parseInt(wn.boot.sysdefaults.float_precision) : null;
this.input.value = format_number(parseFloat(this.input.value), null, decimals);
}
}
}
FloatField.prototype.onmake_input = function() {


+ 1
- 1
public/js/wn/form/formatters.js Dosyayı Görüntüle

@@ -11,7 +11,7 @@ wn.form.formatters = {
parseInt(wn.boot.sysdefaults.float_precision) : null;

return "<div style='text-align: right'>" +
format_number(flt(value, decimals), null, decimals) + "</div>";
format_number(value, null, decimals) + "</div>";
},
Int: function(value) {
return cint(value);


Yükleniyor…
İptal
Kaydet