From eba4ae19d9316efa7f15f7113b82776288b92faa Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 18 Oct 2012 16:33:40 -0700 Subject: Display two decimals --- README.md | 2 +- js/bitcoin_pos.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8d52ae58..8b3e3458 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ It uses the websocket payment notification API from http://blockchain.info/ to d Download market price data into a file called `ticker.json`: - curl "http://bitcoincharts.com/t/depthcalc.json?symbol=virtexCAD&type=bid&amount=1000¤cy=true" > /var/www/bitcoin/ticker.json + curl "http://bitcoincharts.com/t/depthcalc.json?symbol=virtexCAD&type=bid&amount=1000¤cy=true" > ticker.json # Demo Instance diff --git a/js/bitcoin_pos.js b/js/bitcoin_pos.js index 4cbe9ad4..f929a477 100644 --- a/js/bitcoin_pos.js +++ b/js/bitcoin_pos.js @@ -49,10 +49,10 @@ $(function() { } $.getJSON('ticker.json', function (data) { - exchange = 100 / data.out; + exchange = 1000 / data.out; exchange = exchange + exchange * 0.03; exchange = Math.ceil(exchange * 100) / 100; - $('#exchange').val(exchange); + $('#exchange').val(exchange.toFixed(2)); updateTotal(); }); -- cgit v1.2.3