New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

numeric-quantity

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

numeric-quantity - npm Package Versions

23

2.0.1

Diff

Changelog

Source

[v2.0.1] - 2024-01-15

Fixed

  • Corrected links in package.json to distributed type definition files.
jakeboone02
published 2.0.0 •

Changelog

Source

[v2.0.0] - 2023-06-16

Changed

  • [#26] numericQuantity is now a named export; there is no default export.
  • [#26] UMD build assigns all exports, including numericQuantity, to the global object NumericQuantity. Previously, it assigned the main function to the global namespace as numericQuantity.

Added

  • [#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 cause numericQuantity to return NaN unless allowTrailingInvalid is true (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, default false): Allows numericQuantity to more closely resemble the behavior of parseFloat by accepting and ignoring everything from the first invalid character to the end of the string.
    • romanNumerals (boolean, default false): Enables support for Roman numerals with modern, strict rules, including the Unicode code points U+2160 through U+217F. Roman numerals will only be parsed if an attempt to parse the string based on Arabic numerals fails. To parse Roman numerals unconditionally, call parseRomanNumerals directly.
    • round (number | false, default 3): Rounds the result to the specified number of decimal places. Use round: 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.
jakeboone02
published 2.0.0-beta.3 •

jakeboone02
published 2.0.0-beta.2 •

jakeboone02
published 2.0.0-beta.1 •

jakeboone02
published 2.0.0-beta.0 •

jakeboone02
published 1.0.4 •

Changelog

Source

[v1.0.4] - 2022-04-16

Fixed

jakeboone02
published 1.0.3 •

Changelog

Source

[v1.0.3] - 2022-04-16

Added

jakeboone02
published 1.0.2 •

Changelog

Source

[v1.0.2] - 2021-08-23

Added

  • [#21] Support for Unicode fraction slash (, U+2044).
jakeboone02
published 1.0.1 •

Changelog

Source

[v1.0.1] - 2021-02-15

Fixed

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc