Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

any-number-to-words

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

any-number-to-words - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

9

cjs/index.js

@@ -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 @@

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