Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
Revert "Merge pull request #118 from gratipay/trailing-zero"
Browse files Browse the repository at this point in the history
This reverts commit c005194, reversing
changes made to 3c0ddb3.
  • Loading branch information
mattbk committed Apr 2, 2016
1 parent 48503cf commit 066ba6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/v1/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@
Gratipay.users.getPublic(username, function(data) {
element.setAttribute('data-gratipay-readystatus', 'ready');
// If ~user versus team
console.log(data.receiving);
// Solve lack of two significant digits in some cases (http://stackoverflow.com/a/4937261/2152245)
text('receiving', (data.taking)? '$' + parseFloat(data.taking).toFixed(2) : '$' + parseFloat(data.receiving).toFixed(2));
text('receiving', (data.taking)? '$' + data.taking : '$' + data.receiving);
text('username', data.username);
text('my-tip-button', data.my_tip == 'self' ? 'You!' : (+data.my_tip > 0 ? data.my_tip : 'Gratipay')); // jshint ignore:line
text('goal', '$' + data.goal);
Expand Down
4 changes: 2 additions & 2 deletions test/gratipay.com/rummik/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"user_name": "rummik"
}
},
"giving": "0.20",
"giving": "0.00",
"id": 16757,
"ngiving_to": 0,
"ntaking_from": 0,
"on": "gratipay",
"taking": "12.30",
"taking": "12.34",
"username": "rummik"
}

0 comments on commit 066ba6c

Please sign in to comment.