any-number-to-words
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -15,10 +15,9 @@ import Engine from "./engine.js"; | ||
const engine = new Engine(this.locale); | ||
let result = engine.toWords(numberParsed.whole, { ...this.locale, | ||
const mergedLocale = { ...this.locale, | ||
...settings | ||
}); | ||
}; | ||
let result = engine.toWords(numberParsed.whole, mergedLocale); | ||
if (numberParsed.fraction != "0") { | ||
result += ` ${this.locale.names.point} ` + [...numberParsed.fraction].map(digit => engine.toWords(digit, { ...this.locale, | ||
...settings | ||
})).join(" "); | ||
result += ` ${mergedLocale.names.point} ` + [...numberParsed.fraction].map(digit => engine.toWords(digit, mergedLocale)).join(" "); | ||
} | ||
@@ -25,0 +24,0 @@ |
{ | ||
"name": "any-number-to-words", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "A string based number to word converter that can convert pretty large numbers to words in several locales. String is it's limit.", | ||
@@ -5,0 +5,0 @@ "main": "cjs/index.js", |
# Any number to words | ||
Converts any(string is it's limit) decimal number to words in several locales. | ||
A string based number to words converter. It can convert very small or large numbers(just for fun). | ||
@@ -81,5 +81,8 @@ See **[Live Demo](https://any-number-to-words.netlify.app/)** | ||
## Change Log | ||
#### Version 2.0.2 | ||
* Fixed the bug of not translating decimal point for non en-us locales. | ||
#### Version 2.0.1 | ||
* Added documentation. | ||
* Fixed the bug of not translating fractional part of non en-us locales. | ||
* Fixed the bug of not translating fractional part for non en-us locales. | ||
@@ -86,0 +89,0 @@ #### Version 2.0.0 |
@@ -16,6 +16,7 @@ import Engine from "./engine.js"; | ||
const engine = new Engine(this.locale); | ||
let result = engine.toWords(numberParsed.whole, {...this.locale, ...settings}); | ||
const mergedLocale = {...this.locale, ...settings}; | ||
let result = engine.toWords(numberParsed.whole, mergedLocale); | ||
if (numberParsed.fraction != "0") { | ||
result += ` ${this.locale.names.point} ` + [...numberParsed.fraction].map(digit => engine.toWords(digit, {...this.locale, ...settings})).join(" "); | ||
result += ` ${mergedLocale.names.point} ` + [...numberParsed.fraction].map(digit => engine.toWords(digit, mergedLocale)).join(" "); | ||
} | ||
@@ -22,0 +23,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31295
96