[IMP] make float-parsing code more readable by fixing some variable naming
bzr revid: xmo@openerp.com-20111129101334-4uu8v21arkn5h0tu
This commit is contained in:
parent
90dfdbaf6a
commit
b379d95f44
|
@ -159,16 +159,16 @@ openerp.web.parse_value = function (value, descriptor, value_if_empty) {
|
||||||
if (!isNaN(tmp))
|
if (!isNaN(tmp))
|
||||||
return tmp;
|
return tmp;
|
||||||
|
|
||||||
var tmp2 = tmp = value;
|
var tmp2 = value;
|
||||||
do {
|
do {
|
||||||
tmp = tmp2;
|
tmp = tmp2;
|
||||||
tmp2 = tmp.replace(openerp.web._t.database.parameters.thousands_sep, "");
|
tmp2 = tmp.replace(openerp.web._t.database.parameters.thousands_sep, "");
|
||||||
} while(tmp !== tmp2);
|
} while(tmp !== tmp2);
|
||||||
tmp = tmp.replace(openerp.web._t.database.parameters.decimal_point, ".");
|
var reformatted_value = tmp.replace(openerp.web._t.database.parameters.decimal_point, ".");
|
||||||
tmp = Number(tmp);
|
var parsed = Number(reformatted_value);
|
||||||
if (isNaN(tmp))
|
if (isNaN(parsed))
|
||||||
throw new Error(value + " is not a correct float");
|
throw new Error(value + " is not a correct float");
|
||||||
return tmp;
|
return parsed;
|
||||||
case 'float_time':
|
case 'float_time':
|
||||||
var float_time_pair = value.split(":");
|
var float_time_pair = value.split(":");
|
||||||
if (float_time_pair.length != 2)
|
if (float_time_pair.length != 2)
|
||||||
|
|
Loading…
Reference in New Issue