Bug #19442
closedWhen inserting prices in tx_commerce the input is always transformed into NaN##
0%
Description
jsfunc.js seems to interpret prices incorrect.
Examples:
122.00 is transferred into "NaN00"
1888.12 is transferred into "NaN12"
0 is not transferred. Blank neither.
(issue imported from #M9524)
Updated by Stefano Cecere about 16 years ago
i confirm this bug!
(on common decimal fields!!!)
Updated by Stefano Cecere about 16 years ago
it seems the bug is in line 172 of jsfunc.evalfield.js
theVal=this.parseInt(this.noSpace(theVal))+TS.decimalSign+dec.substr(0,2);
it's this function call that returns the NaN00
Updated by Stefano Cecere about 16 years ago
is seems that that TS.decimalSign variable is undefined .. where does it come from?
Updated by Stefano Cecere about 16 years ago
yes the problem is that TS.decimalSign undefined...
Updated by Stefano Cecere about 16 years ago
yes i found it...:
function typoSetup () {
this.passwordDummy = '********';
this.decimalSign = '.';
}
var TS = new typoSetup();
but checking the whole script running (via Firebug) TS.decimalSign is undefined when it is called jsfunc.evalfield.js
the bug happens either in FF 3 and Safari 3 (so it isn't another FF 3 quirk)
Updated by Stefano Cecere about 16 years ago
could it be it is because jsfunc.evalfield.js is loaded in the main page header, and jsfunc.tbe_editor.js in the sub sub iframe of the page?
Updated by Stefano Cecere about 16 years ago
yes, it is the same problem (the order of loading .js files and the TS object not istantiated)