mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-03 08:46:40 +00:00
JS: Add Amount.set_currency().
This commit is contained in:
committed by
Stefan Thomas
parent
3be3c8a213
commit
799d78b2ed
@@ -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