Skip to content

Commit

Permalink
parse double and floats
Browse files Browse the repository at this point in the history
When type is xs:double or xs:float we use parseFloat to convert it to javascript.
  • Loading branch information
Leon Radley committed Oct 18, 2017
1 parent 24e4b30 commit dd07a48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/wsdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,8 @@ WSDL.prototype.xmlToObject = function(xml, callback) {
else {
if (name === 'int' || name === 'integer') {
value = parseInt(text, 10);
} else if (name === 'double' || name === 'float') {
value = parseFloat(text);
} else if (name === 'bool' || name === 'boolean') {
value = text.toLowerCase() === 'true' || text === '1';
} else if (name === 'dateTime' || name === 'date') {
Expand Down

0 comments on commit dd07a48

Please sign in to comment.