Skip to content

Commit

Permalink
Fixes #6 : parseFloat on special thousands formated number
Browse files Browse the repository at this point in the history
  • Loading branch information
gclement authored and gclement committed Jun 14, 2017
1 parent aff9481 commit 3fc7ddc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/overwatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ let OverwatchProvider = function () {
}

String.prototype.cast = function () {
if (this.indexOf('.') > 0 && this.indexOf(',') > 0) return parseFloat(this.replace(',',''));
if (this.indexOf('.') > 0) return parseFloat(this);
if (this.indexOf(':') > 0 || this.split(' ').length > 1) return this.toTimestamp();
return parseInt(this.replace(/,/g, ''));
Expand Down Expand Up @@ -199,7 +200,6 @@ let OverwatchProvider = function () {
}

let handle = (err) => {
console.log(err);
switch (err.response.statusCode) {
case 404:
throw new Error('PROFILE_NOT_FOUND');
Expand Down

0 comments on commit 3fc7ddc

Please sign in to comment.