From 33611cdede6cffd326bf49bfd81bfd3f6598332b Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Mon, 3 Dec 2012 17:10:33 -0800 Subject: [PATCH] Add signed option to to_human output. --- src/js/amount.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/amount.js b/src/js/amount.js index b34018cf16..ee73ea1742 100644 --- a/src/js/amount.js +++ b/src/js/amount.js @@ -513,6 +513,7 @@ Amount.prototype.to_human = function (opts) } var formatted = ''; + if (opts.signed && this._is_negative) formatted += "- "; formatted += int_part.length ? int_part : '0'; formatted += fraction_part.length ? '.'+fraction_part : '';