made with requirebin
Last active
August 29, 2015 14:13
-
-
Save evanlucas/ece0d1de7d98e61642fa to your computer and use it in GitHub Desktop.
requirebin sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require() some stuff from npm (like you were using browserify) | |
// and then hit Rebuild to run it on the right | |
var xpy = 0.12345678 | |
var btc = 0.011 | |
var priceFormatted = Number(xpy * btc) | |
var price = Number(xpy * btc) | |
document.body.innerHTML = '<div>price: ' + price + | |
'</div><div>formatted: ' + priceFormatted + '</div>' | |
var goback = Number(+priceFormatted / btc).toFixed(8) | |
document.body.innerHTML = document.body.innerHTML + '<div>back: ' + goback + '</div>' | |
var a = 0.1 | |
var b = 0.2 | |
document.body.innerHTML = document.body.innerHTML + '<div>test: ' + (a + b) + '</div>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xpy=.12345678;var btc=.011;var priceFormatted=Number(xpy*btc).toFixed(15);var price=Number(xpy*btc);document.body.innerHTML="<div>price: "+price+"</div><div>formatted: "+priceFormatted+"</div>";var goback=Number(+priceFormatted/btc).toFixed(8);document.body.innerHTML=document.body.innerHTML+"<div>back: "+goback+"</div>";var a=.1;var b=.2;document.body.innerHTML=document.body.innerHTML+"<div>test: "+(a+b)+"</div>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "requirebin-sketch", | |
"version": "1.0.0" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; } | |
body, html { height: 100%; width: 100%; }</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment