All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- N/A
- Corrected links in
package.json
to distributed type definition files.
v2.0.0 - 2023-06-16
- #26
numericQuantity
is now a named export; there is no default export. - #26 UMD build assigns all exports, including
numericQuantity
, to the global objectNumericQuantity
. Previously, it assigned the main function to the global namespace asnumericQuantity
.
- #26 Support for comma (
','
) and underscore ('_'
) separators within Arabic numeral sequences. If a numeric sequence has a leading or trailing separator, that sequence will be considered invalid. This will causenumericQuantity
to returnNaN
unlessallowTrailingInvalid
istrue
(see next item), in which case the sequence in question and everything after it will be ignored. - #26 Options object as optional second parameter. Accepts the following options:
allowTrailingInvalid
(boolean
, defaultfalse
): AllowsnumericQuantity
to more closely resemble the behavior ofparseFloat
by accepting and ignoring everything from the first invalid character to the end of the string.romanNumerals
(boolean
, defaultfalse
): Enables support for Roman numerals with modern, strict rules, including the Unicode code pointsU+2160
throughU+217F
. Roman numerals will only be parsed if an attempt to parse the string based on Arabic numerals fails. To parse Roman numerals unconditionally, callparseRomanNumerals
directly.round
(number | false
, default3
): Rounds the result to the specified number of decimal places. Useround: false
to avoid rounding.
- #26 Support for Unicode "Fraction Numerator One" code point (
'⅟'
,U+215F
), which must be followed by a numeric sequence (the denominator) to be considered part of a valid fraction representation. - #26 Named exports of internal utilities like regular expressions, character maps, types, etc.
- #26 Build with tsup.
v1.0.4 - 2022-04-16
- Corrected filenames in package.json.
v1.0.3 - 2022-04-16
- Build with Vite.
v1.0.2 - 2021-08-23
- #21 Support for Unicode fraction slash (
⁄
,U+2044
).
v1.0.1 - 2021-02-15
- Added description to package.json.
v1.0.0 - 2021-02-11
v0.5.2 - 2021-02-08
- Updated CI badges on README.md.
v0.5.1 - 2019-08-24
- README.md note about return values.
v0.5.0 - 2019-08-24
- Returns
NaN
for invalid inputs instead of-1
.
- #3 Handles negative numbers.
v0.4.2 - 2019-08-23
- Publish
dist
directory only.
v0.4.1 - 2019-08-23
- Rewritten in TypeScript.
- Build with Rollup.
v0.4.0 - 2019-08-22
- ESM and CJS builds.
v0.3.3 - 2019-07-21
- JSDoc comments for tooltips
v0.3.2 - 2018-09-21
- TypeScript types.
v0.3.1 - 2015-07-16
- Documentation update.
v0.3.0 - 2015-07-16
- UMD support.
- Minor bug fixes.
v0.2.0 - 2015-05-14
- #1 Accept decimals without a leading zero.
v0.1.2 - 2015-03-20
- Minor performance improvement.
v0.1.1 - 2015-03-19
- Use
parseInt
/parseFloat
instead ofstr - 0
to parse numbers from strings.
v0.1.0 - 2015-03-18
- Initial release.