View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001765 | NOALYSS | Improve Use | public | 2019-10-22 19:03 | 2019-10-26 10:50 |
| Reporter | danydb | Assigned To | danydb | ||
| Priority | normale | Severity | mineur | Reproducibility | sans objet |
| Status | fermé | Resolution | corrigé | ||
| Product Version | 7.1 | ||||
| Target Version | 7.1.1 | Fixed in Version | 7.1.1 | ||
| Summary | 0001765: Permettre les opérations mathématiques dans les champs numériques | ||||
| Description | Contribution externe, code à intégrer | ||||
| Additional Information | function compute_number(value) { var retval = 0; var exp=new RegExp("^[0-9/*+-.]+$","g"); /*pour éviter un eval() mal intentionné*/ var res = exp.test(value); if (res) { /*pour gérer un nombre non valide comme 5..36 ou 5.3.6 parce qu'il est possible d'entrer plusieurs points dans le nombre et eval() lève une exception*/ try { retval = eval(value); } catch { return 0; } /*pour gérer les divisions par 0*/ if (retval == Infinity) { return 0; } else { return retval; } } else { return 0; } } function format_number(obj, p_prec) { var precision = 2; if (p_prec === undefined) { precision = 2; } else { precision = p_prec; } var value = obj.value; value = value.replace(/,/, '.'); value = compute_number(value); /*modification*/ value = parseFloat(value); if (isNaN(value)) { value = 0; } var arrondi = Math.pow(10, precision); value = Math.round(value * arrondi) / arrondi; $(obj).value = value; } | ||||
| Tags | No tags attached. | ||||
| Extension Noalyss | Aucun | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2019-10-22 19:03 | danydb | New Issue | |
| 2019-10-26 00:40 | danydb | Assigned To | => danydb |
| 2019-10-26 00:40 | danydb | Status | new => resolved |
| 2019-10-26 00:40 | danydb | Resolution | open => fixed |
| 2019-10-26 00:40 | danydb | Fixed in Version | => Next Release |
| 2019-10-26 10:49 | danydb | Target Version | Next Release => 7.1.1 |
| 2019-10-26 10:50 | danydb | Fixed in Version | Next Release => 7.1.1 |
| 2019-10-26 10:50 | danydb | Status | resolved => closed |