I have an object:
var seriesOptions = {
y: parseFloat($(this).find('y').text()).toFixed(2),
color: colors[index],
level : dlevel
};
Where I am parsing and assigning value via reading a XML tree structure:
<series> <!-- $this--><y>55.34</y></series>
Below the code I make a copy of the object
series = $.extend(true, {}, seriesOptions);
The issue I am facing is that the “y” property gets converted from 55.34 to “55.34” (converted to string type) which makes my code behaving faulty. Is there a way I can copy seriesOptions.y to series.y as integer itself?
You could use
Instead of
And your
'y'will benumber, notstring.