Math interval formatter
Parse math interval object to string.
Install
$ npm install --save math-interval-formatter
Usage
format(interval, options)
var format = ; var interval = from: value: -MathPI included: true to: value: Infinity included: false ; ;//=> '[-3.142,Infinity)' ;//=> '[3.1416, +∞)'
See tests for more details.
Available options
-
format
- 'default' //=> '[-10,10]'
- 'pretty' //=> '[-10, 10]'
- 'interval' //=> '[-10..10]'
-
excludedEndpoints
- 'parenthesis' //=> '(-10,10)'
- 'reversed' //=> ']-10,10['
-
infiniteEndpoints
- 'default' //=> '[0,Infinity)'
- 'none' //=> '[0,)'
- 'math' //=> '[0,∞)'
-
numberFormat
// default '0.[000]'- See available formats in simple-number-formatter repo
License
MIT © Dmitry Semigradsky