mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
Upgraded to fraction.js v1.9.0
This commit is contained in:
parent
55d8e4f323
commit
e6cbc8a346
@ -111,7 +111,7 @@ exports.create = function create(type) {
|
||||
from: 'Fraction',
|
||||
to: 'number',
|
||||
convert: function (x) {
|
||||
return x.toNumber();
|
||||
return x.valueOf();
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
@ -6,15 +6,6 @@ var Fraction = require('fraction.js');
|
||||
Fraction.prototype.type = 'Fraction';
|
||||
Fraction.prototype.isFraction = true;
|
||||
|
||||
/**
|
||||
* Get the primitive value of a Fraction, a number
|
||||
* @return {number} Returns a number
|
||||
*/
|
||||
// TODO: remove this when Fraction.js supports this itself.
|
||||
Fraction.prototype.valueOf = function () {
|
||||
return this.toNumber();
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a JSON representation of a Fraction containing type information
|
||||
* @returns {Object} Returns a JSON object structured as:
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"decimal.js": "^4.0.2",
|
||||
"fraction.js": "^1.7.0",
|
||||
"fraction.js": "^1.9.0",
|
||||
"tiny-emitter": "^1.0.0",
|
||||
"typed-function": "^0.8.2"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user