From 74dac97b368493056474468520f05671f458a69f Mon Sep 17 00:00:00 2001 From: Chris Clark Date: Fri, 10 Apr 2015 12:56:50 -0700 Subject: [PATCH] Add Amount.scale --- src/js/ripple/amount.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/ripple/amount.js b/src/js/ripple/amount.js index 40eb0e16a1..41a4151234 100644 --- a/src/js/ripple/amount.js +++ b/src/js/ripple/amount.js @@ -1,4 +1,4 @@ - 'use strict'; +'use strict'; // Represent Ripple amounts and currencies. // - Numbers in hex are big-endian. @@ -156,6 +156,10 @@ Amount.prototype.multiply = function(multiplicand) { return this._copy(this._value.times(multiplyBy)); }; +Amount.prototype.scale = function(scaleFactor) { + return this._copy(this._value.times(scaleFactor)); +}; + Amount.prototype.divide = function(divisor) { var divisorAmount = Amount.from_json(divisor); if (!this.is_valid()) {