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

chinese-numbers-converter

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chinese-numbers-converter - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

2

package.json
{
"name": "chinese-numbers-converter",
"version": "2.0.4",
"version": "2.0.5",
"description": "Converts Chinese numerals in a string into Arabic numerals.",

@@ -5,0 +5,0 @@ "main": "chinese-numbers.js",

@@ -14,3 +14,3 @@ # chinese-numbers-converter.js

- `toInteger()` - converts a Chinese or mixed number into Arabic and returns a JavaScript `Number` type.
- `toArabicString()` - translates the entire string (possibly with multiple numbers in it) and returns the same string, but with Arabic numbers.
- `toArabicString(minChars)` - translates the entire string (possibly with multiple numbers in it) and returns the same string, but with Arabic numbers. The optional parameter `minChars` is the minimum number of characters that will be translated. For example, you can set it to `2` to avoid translating `九龍` into `9龍`.
- `isNumberOrSpace()` - checks whether the character is part of a number (`true`) or unrelated text (`false`).

@@ -31,3 +31,4 @@

```js
new ChineseNumber(' 二百 or 兩百').toInteger(); // 400 - do not try to parse multiple numbers at once
new ChineseNumber(' 二百 or 兩百').toInteger(); // 400 - the toInteger() method only parses one number at once. Use toArabicString() instead.
new ChineseNumber('九龍').toArabicString(); // 9龍 - use the minChars parameter to avoid this
```

@@ -39,7 +40,1 @@

- NPM package - `chinese-numbers-converter`
## License and contributing ##
Unlicense / Public domain. You can do everything.
Pull requests and bug reports are welcome.
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