From 0a05952ecb10d268e6c73a043c7b2b2bc5c12a36 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 23 Nov 2015 01:55:38 -0500 Subject: display totals --- StoneIsland/www/js/vendor/util.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'StoneIsland/www/js/vendor/util.js') diff --git a/StoneIsland/www/js/vendor/util.js b/StoneIsland/www/js/vendor/util.js index 6523d50e..23f55d4c 100644 --- a/StoneIsland/www/js/vendor/util.js +++ b/StoneIsland/www/js/vendor/util.js @@ -28,6 +28,12 @@ function title_case (str) { return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}); } function pluralize (n,s,ss) { return n + " " + s + ( n == 1 ? "" : (ss || "s") ) } +function as_cash(n){ + var cents = ((n*100) % 100); + if (cents < 10) { cents = "0" + (cents|0) } + else { cents = cents|0 } + return "$" + (n|0) + "." + cents +} var E = Math.E var PI = Math.PI -- cgit v1.2.3-70-g09d2