mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
JS: Add Amount.set_currency().
This commit is contained in:
@@ -388,6 +388,18 @@ Amount.prototype.currency = function() {
|
||||
return this._currency;
|
||||
};
|
||||
|
||||
Amount.prototype.set_currency = function(c) {
|
||||
if ('string' === typeof c) {
|
||||
this._currency.parse_json(c);
|
||||
}
|
||||
else
|
||||
{
|
||||
c.copyTo(this._currency);
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
// Only checks the value. Not the currency and issuer.
|
||||
Amount.prototype.is_valid = function() {
|
||||
return !isNaN(this._value);
|
||||
|
||||
Reference in New Issue
Block a user