n2words 1.12.0 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,6 +56,7 @@ export default class {
56
56
  } else {
57
57
  const splittedValue = positiveValue.toString().split('.');
58
58
  const wholeNumberStr = this.toCardinal(parseInt(splittedValue[0], 10));
59
+ this.wholeNumberInt = parseInt(splittedValue[0]);
59
60
 
60
61
  let decimalPart = splittedValue[1];
61
62
 
package/lib/i18n/CZ.mjs CHANGED
@@ -5,7 +5,6 @@ export class N2WordsCZ extends N2WordsRU {
5
5
  super();
6
6
 
7
7
  this.negativeWord = 'mínus';
8
- this.separatorWord = 'celá';
9
8
  this.zero = 'nula';
10
9
  this.ones = {
11
10
  1: 'jedna',
@@ -42,14 +41,14 @@ export class N2WordsCZ extends N2WordsRU {
42
41
  };
43
42
  this.hundreds = {
44
43
  1: 'sto',
45
- 2: 'dvěstě',
46
- 3: 'třista',
47
- 4: 'čtyřista',
48
- 5: 'pětset',
49
- 6: 'šestset',
50
- 7: 'sedmset',
51
- 8: 'osmset',
52
- 9: 'devětset'
44
+ 2: 'dvě stě',
45
+ 3: 'tři sta',
46
+ 4: 'čtyři sta',
47
+ 5: 'pět set',
48
+ 6: 'šest set',
49
+ 7: 'sedm set',
50
+ 8: 'osm set',
51
+ 9: 'devět set'
53
52
  };
54
53
  this.thousands = {
55
54
  1: ['tisíc', 'tisíce', 'tisíc'], // 10^ 3
@@ -65,6 +64,18 @@ export class N2WordsCZ extends N2WordsRU {
65
64
  };
66
65
  }
67
66
 
67
+ get separatorWord() {
68
+ if (this.wholeNumberInt === 0 || this.wholeNumberInt === 1) {
69
+ return 'celá';
70
+ } else if (this.wholeNumberInt >= 2 && this.wholeNumberInt <= 4) {
71
+ return 'celé';
72
+ } else {
73
+ return 'celých';
74
+ }
75
+ }
76
+
77
+ set separatorWord(value) {}
78
+
68
79
  pluralize(n, forms) {
69
80
  let form = 2;
70
81
  if (n == 1) {
package/lib/n2words.mjs CHANGED
@@ -131,5 +131,7 @@ export default function(n, options = {lang: 'en'}) {
131
131
  return n2wordsZH(n);
132
132
  } else if (lang === 'VI') {
133
133
  return n2wordsVI(n);
134
+ } else {
135
+ return n2wordsEN(n);
134
136
  }
135
137
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n2words",
3
- "version": "1.12.0",
3
+ "version": "1.12.2",
4
4
  "description": "Convert numbers to words, in multiple languages",
5
5
  "main": "dist/n2words.js",
6
6
  "scripts": {
@@ -56,19 +56,19 @@
56
56
  },
57
57
  "homepage": "https://github.com/forzagreen/n2words#readme",
58
58
  "devDependencies": {
59
- "@babel/core": "^7.18.5",
60
- "@babel/preset-env": "^7.18.2",
61
- "ava": "^4.3.3",
62
- "babel-loader": "^8.2.5",
63
- "c8": "^7.11.3",
64
- "core-js": "^3.23.2",
65
- "eslint": "^8.18.0",
66
- "eslint-plugin-ava": "^13.2.0",
67
- "eslint-plugin-import": "^2.26.0",
68
- "eslint-plugin-jsdoc": "^39.3.3",
59
+ "@babel/core": "^7.20.12",
60
+ "@babel/preset-env": "^7.20.2",
61
+ "ava": "^5.2.0",
62
+ "babel-loader": "^9.1.2",
63
+ "c8": "^7.12.0",
64
+ "core-js": "^3.27.2",
65
+ "eslint": "^8.33.0",
66
+ "eslint-plugin-ava": "^14.0.0",
67
+ "eslint-plugin-import": "^2.27.5",
68
+ "eslint-plugin-jsdoc": "^39.8.0",
69
69
  "eslint-plugin-node": "^11.1.0",
70
- "webpack": "^5.73.0",
71
- "webpack-cli": "^4.10.0"
70
+ "webpack": "^5.75.0",
71
+ "webpack-cli": "^5.0.1"
72
72
  },
73
73
  "ava": {
74
74
  "files": [
package/webpack.config.js CHANGED
@@ -20,7 +20,7 @@ module.exports = {
20
20
  '@babel/preset-env',
21
21
  {
22
22
  useBuiltIns: 'usage',
23
- corejs: '3.23.2',
23
+ corejs: '3.27.2',
24
24
  },
25
25
  ],
26
26
  ],
package/CHANGELOG.md DELETED
@@ -1,171 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
7
-
8
- ## [1.12.0] - 2022-09-01
9
-
10
- ### Added
11
- - New language: `vi` Vietnamese [#69](https://github.com/forzagreen/n2words/pull/69).
12
-
13
- ### Changed
14
- - Bump dev dependencies [#68](https://github.com/forzagreen/n2words/pull/68). Thanks to [@TylerVigario](https://github.com/TylerVigario) !
15
-
16
-
17
- ## [1.11.1] - 2022-04-08
18
-
19
- ### Changed
20
- - Improve README [#67](https://github.com/forzagreen/n2words/pull/67) [#66](https://github.com/forzagreen/n2words/pull/66). Thanks to [@TylerVigario](https://github.com/TylerVigario) !
21
- - Update dev dependencies (Webpack, ESLint...) [#65](https://github.com/forzagreen/n2words/pull/65). Thanks to [@TylerVigario](https://github.com/TylerVigario) !
22
-
23
-
24
- ## [1.11.0] - 2022-01-08
25
-
26
- ### Added
27
- - New language: `hr` Croatian [#61](https://github.com/forzagreen/n2words/pull/61). Thanks to [@lagavuliner](https://github.com/lagavuliner) !
28
-
29
- ### Fixed
30
- - Fix translations for Serbian [#60](https://github.com/forzagreen/n2words/pull/60) [#61](https://github.com/forzagreen/n2words/pull/61). Thanks to [@lagavuliner](https://github.com/lagavuliner) !
31
-
32
-
33
- ## [1.10.1] - 2021-10-31
34
-
35
- ### Fixed
36
- - Correct translation of number 18 for NL.mjs [#59](https://github.com/forzagreen/n2words/pull/59). Thanks to [@K4CZP3R](https://github.com/K4CZP3R) !
37
- - Update dev dependencies.
38
-
39
-
40
- ## [1.10.0] - 2021-08-22
41
- ### Added
42
- - New language: `id` Indonesian [#58](https://github.com/forzagreen/n2words/pull/58).
43
-
44
- ### Changed
45
- - Migrate to ES6 classes [#55](https://github.com/forzagreen/n2words/pull/55). Thanks to [@TylerVigario](https://github.com/TylerVigario) !
46
-
47
- ### Fixed
48
- - Accept numbers as string [#57](https://github.com/forzagreen/n2words/pull/57).
49
-
50
-
51
- ## [1.9.1] - 2021-08-14
52
- ### Changed
53
- - Configs: update dependencies, linting, camelCase [#51](https://github.com/forzagreen/n2words/pull/51). Thanks to [@TylerVigario](https://github.com/TylerVigario) !
54
-
55
- ### Fixed
56
- - Fix Polish translation [#49](https://github.com/forzagreen/n2words/pull/49). Thanks to [@krzyhan](https://github.com/krzyhan) !
57
-
58
- ## [1.9.0] - 2020-12-19
59
- ### Added
60
- - New language: `zh` Chinese [#43](https://github.com/forzagreen/n2words/pull/43). Thanks to [@ljinke](https://github.com/ljinke) !
61
- - New language: `hu` Hungarian [#44](https://github.com/forzagreen/n2words/pull/44).
62
- - Support for negative numbers [#42](https://github.com/forzagreen/n2words/pull/42).
63
-
64
- ### Changed
65
- - Turkish: added spaces between words, and added `dropSpaces` option [#41](https://github.com/forzagreen/n2words/pull/41).
66
- - Improved linting [#45](https://github.com/forzagreen/n2words/pull/45).
67
-
68
-
69
- ## [1.8.0] - 2020-11-11
70
- ### Added
71
- - Support for decimal numbers [#34](https://github.com/forzagreen/n2words/pull/34), [#39](https://github.com/forzagreen/n2words/pull/39). Thanks to [@dylandoamaral](https://github.com/dylandoamaral) !
72
- - New language: `fa` Farsi/Persian [#38](https://github.com/forzagreen/n2words/pull/38). Thanks to [@omarius](https://github.com/omarius) !
73
-
74
- ### Changed
75
- - Update dev dependencies, move src/ to lib/ [#36](https://github.com/forzagreen/n2words/pull/36). Thanks to [@TylerVigario](https://github.com/TylerVigario) !
76
-
77
-
78
- ## [1.7.1] - 2020-07-10
79
- ### Changed
80
- - Dutch (`nl`) Improvements [#31](https://github.com/forzagreen/n2words/issues/31) and [#32](https://github.com/forzagreen/n2words/pull/32).
81
- - Normalize line endings and improve linting [#30](https://github.com/forzagreen/n2words/pull/30).
82
-
83
- ## [1.7.0] - 2020-04-03
84
- ### Added
85
- - New language: `nl` Dutch [#27](https://github.com/forzagreen/n2words/pull/27). Thanks to [@jvanaert](https://github.com/jvanaert) !
86
- - New language: `sr` Serbian [#29](https://github.com/forzagreen/n2words/pull/29)
87
-
88
-
89
- ## [1.6.2] - 2020-03-15
90
-
91
- ### Changed
92
- - Improve CI/CD: drop TravisCI, use Coveralls from Github Actions [#24](https://github.com/forzagreen/n2words/issues/24), [#25](https://github.com/forzagreen/n2words/issues/25)
93
- - Rename source ES Modules with .mjs extension [#26](https://github.com/forzagreen/n2words/issues/26)
94
-
95
-
96
- ## [1.6.1] - 2020-03-09
97
-
98
- ### Fixed
99
- - Include src/ in npm publish: [#21](https://github.com/forzagreen/n2words/issues/21)
100
-
101
-
102
- ## [1.6.0] - 2020-03-08
103
- ### Added
104
- - Compatibility: CommonJS, ES6, Browser.
105
- - New language: `ar` Arabic [#15](https://github.com/forzagreen/n2words/pull/15)
106
- - New language: `ko` Korean [#18](https://github.com/forzagreen/n2words/pull/18)
107
- - New language: `he` Hebrew [#17](https://github.com/forzagreen/n2words/pull/17)
108
-
109
- ### Changed
110
- - Refactor project structure. Thanks to [@MeekLogic](https://github.com/MeekLogic) ! [#16](https://github.com/forzagreen/n2words/pull/16) [#19](https://github.com/forzagreen/n2words/pull/19)
111
- - Build with [webpack](https://webpack.js.org)
112
- - Unit tests with [ava](https://github.com/avajs/ava)
113
- - Coverage migrated to [c8](https://github.com/bcoe/c8) : [#20](https://github.com/forzagreen/n2words/pull/20)
114
- - Linter: [ESLint](https://eslint.org)
115
- - Modules
116
-
117
-
118
-
119
- ## [1.5.0] - 2020-03-01
120
- ### Added
121
- - Add browser compatibility, using Babel and Grunt.
122
- - New language: `lv` Latvian [#14](https://github.com/forzagreen/n2words/pull/14)
123
- - New language: `lt` Lithuanian [#13](https://github.com/forzagreen/n2words/pull/13)
124
- - New language: `uk` Ukrainian [#12](https://github.com/forzagreen/n2words/pull/12)
125
- - New language: `pl` Polish [#11](https://github.com/forzagreen/n2words/pull/11)
126
-
127
-
128
- ## [1.4.1] - 2020-02-25
129
- ### Added
130
- - New language: `dk` Danish [#9](https://github.com/forzagreen/n2words/pull/9)
131
- - New language: `no` Norwegian [#8](https://github.com/forzagreen/n2words/pull/8)
132
- - New language: `cz` Czech [#7](https://github.com/forzagreen/n2words/pull/7)
133
- - New language: `ru` Russian [#6](https://github.com/forzagreen/n2words/pull/6)
134
-
135
- ### Changed
136
- - CI/CD: use a fake NPM_TOKEN
137
-
138
- ### Fixed
139
- - Fix 21 in italian : [#4](https://github.com/forzagreen/n2words/issues/4) , [#5](https://github.com/forzagreen/n2words/pull/5)
140
-
141
- ## [1.3.2] - 2020-02-14
142
- ### Fixed
143
- - Capital letter in German: [#2](https://github.com/forzagreen/n2words/issues/2)
144
- - Replace `eval` with `if else` : [#1](https://github.com/forzagreen/n2words/issues/1)
145
- ### Changed
146
- - Update `mochajs` test package to `v7.0.1`
147
-
148
- ## [1.3.1] - 2019-12-28
149
- ### Added
150
- - Support for new language: `tr`.
151
- - CI/CD with GitHub Actions.
152
- - `.npmignore`, `.npmrc`, and publish from CI/CD.
153
- ### Changed
154
- - Split tests to one file per language
155
- - Update dev packages
156
-
157
- ## [1.2.0] - 2019-03-23
158
- ### Added
159
- - Support for language: `it`.
160
-
161
- ## [1.1.0] - 2019-03-18
162
- ### Added
163
- - Support for languages: `de`, `pt`.
164
-
165
- ## [1.0.0] - 2019-03-08
166
- ### Added
167
- - Started the n2words project.
168
- - Support for languages: `en`, `fr`, `es`.
169
- - Unit test with Mocha and nyc
170
- - Coverage with coveralls and nyc
171
-