ml-regression-base
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -0,1 +1,11 @@ | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/mljs/ml-regression-base/compare/v1.0.0...v1.1.0) (2017-04-28) | ||
### Features | ||
* add maybeToPrecision ([04a5f9a](https://github.com/mljs/ml-regression-base/commit/04a5f9a)) | ||
<a name="1.0.0"></a> | ||
@@ -2,0 +12,0 @@ # 1.0.0 (2017-04-28) |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
function maybeToPrecision(value, digits) { | ||
if (value < 0) { | ||
value = 0 - value; | ||
if (typeof digits === 'number') { | ||
return '- ' + value.toPrecision(digits); | ||
} else { | ||
return '- ' + value.toString(); | ||
} | ||
} else { | ||
if (typeof digits === 'number') { | ||
return value.toPrecision(digits); | ||
} else { | ||
return value.toString(); | ||
} | ||
} | ||
} | ||
class BaseRegression { | ||
@@ -87,2 +106,3 @@ constructor() { | ||
module.exports = BaseRegression; | ||
exports['default'] = BaseRegression; | ||
exports.maybeToPrecision = maybeToPrecision; |
{ | ||
"name": "ml-regression-base", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Base class for regression modules", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -33,2 +33,8 @@ # ml-regression-base | ||
### `maybeToPrecision(value, digits)` | ||
This package also exports a convenience method to transform numbers to readable strings.<br /> | ||
If digits is not specified, "value.toString()" is used. Otherwise "value.toPrecision(digits)" is used.<br /> | ||
This method can be used to implement `toString()` or `toLaTeX()`. | ||
## License | ||
@@ -35,0 +41,0 @@ |
@@ -0,1 +1,3 @@ | ||
export {default as maybeToPrecision} from './maybeToPrecision'; | ||
export default class BaseRegression { | ||
@@ -2,0 +4,0 @@ constructor() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12331
9
269
49