Skip to content
Permalink
Browse files

fix token units

  • Loading branch information...
elaineo committed Mar 20, 2017
1 parent 4714254 commit 6376232143b74fa3f0d66a218309c66e03c0c6b4
Showing with 6 additions and 5 deletions.
  1. +3 −2 public/js/controllers/TokenController.js
  2. +1 −1 public/views/token.html
  3. +2 −2 routes/token.js
@@ -8,7 +8,8 @@ angular.module('BlocksApp').controller('TokenController', function($stateParams,
$scope.activeTab = activeTab[1];

$rootScope.$state.current.data["pageSubTitle"] = $stateParams.hash; //replace with token name
var address = isAddress($stateParams.hash) ? $stateParams.hash : undefined;
$scope.addrHash = isAddress($stateParams.hash) ? $stateParams.hash : undefined;
var address = $scope.addrHash;
$scope.token = {"balance": 0};

//fetch dao stuff
@@ -42,7 +43,7 @@ angular.module('BlocksApp').controller('TokenController', function($stateParams,
}).success(function(data) {
console.log(data)
$scope.showTokens = true;
$scope.token.tokens = data.tokens;
$scope.userTokens = data.tokens;
});
} else
$scope.errors.address = "Invalid Address";
@@ -86,7 +86,7 @@ <h4>Get {{ token.name }} Token Balance</h4>
</div><!--end row-->
<div class="row" ng-show="showTokens"><!-- balance results -->
<div class="col-md-10">
<h4>You have <span class="eth-stat-title font-blue-madison">0{{token.tokens | number}}</span> {{ token.name }} tokens.</h4>
<h4>You have <span class="eth-stat-title font-blue-madison">0{{userTokens | number}}</span> {{ token.name }} tokens.</h4>
</div>
</div>
</div><!-- end get Token Balance Tab -->
@@ -28,7 +28,7 @@ module.exports = function(req, res){
var actualBalance = eth.getBalance(contractAddress);
actualBalance = etherUnits.toEther(actualBalance, 'wei');
var totalSupply = Token.totalSupply();
totalSupply = etherUnits.toEther(totalSupply, 'wei')*100;
// totalSupply = etherUnits.toEther(totalSupply, 'wei')*100;
var count = eth.getTransactionCount(contractAddress);
var tokenData = {
"balance": actualBalance,
@@ -45,7 +45,7 @@ module.exports = function(req, res){
var addr = req.body.user.toLowerCase();
try {
var tokens = Token.balanceOf(addr);
tokens = etherUnits.toEther(tokens, 'wei')*100;
// tokens = etherUnits.toEther(tokens, 'wei')*100;
res.write(JSON.stringify({"tokens": tokens}));
res.end();
} catch (e) {

0 comments on commit 6376232

Please sign in to comment.
You can’t perform that action at this time.