mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Merge branch 'develop' of https://github.com/ripple/ripple-lib into develop
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ripple-lib",
|
||||
"version": "0.7.18",
|
||||
"version": "0.7.19",
|
||||
"description": "Ripple JavaScript client library",
|
||||
"files": [
|
||||
"src/js/ripple/*.js",
|
||||
|
||||
@@ -556,6 +556,21 @@ Amount.prototype.negate = function () {
|
||||
return this.clone('NEGATE');
|
||||
};
|
||||
|
||||
/**
|
||||
* Invert this amount and return the new value.
|
||||
*
|
||||
* Creates a new Amount object as a copy of the current one (including the same
|
||||
* unit (currency & issuer), inverts it (1/x) and returns the result.
|
||||
*/
|
||||
Amount.prototype.invert = function () {
|
||||
var one = this.clone();
|
||||
one._value = BigInteger.ONE;
|
||||
one._offset = 0;
|
||||
one._is_negative = false;
|
||||
one.canonicalize();
|
||||
return one.ratio_human(this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Tries to correctly interpret an amount as entered by a user.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user