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

to-words

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-words - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

7

CHANGELOG.md

@@ -1,2 +0,7 @@

---
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [2.0.1](https://github.com/mastermunj/to-words/compare/v2.0.0...v2.0.1) (2020-04-23)
## 2.0.0 (2020-04-23)

@@ -3,0 +8,0 @@

2

package.json
{
"name": "to-words",
"version": "2.0.0",
"version": "2.0.1",
"description": "Converts numbers (including decimal points) into words & currency.",

@@ -5,0 +5,0 @@ "main": "dist/to-words.js",

@@ -21,3 +21,3 @@ # Number to Words

```js
Import { ToWords } from 'to-words';
import { ToWords } from 'to-words';
```

@@ -40,7 +40,11 @@

const toWords = new ToWords();
let words = toWords.convert(123); // words = One Hundred Twenty Three
words = toWords.convert(123.45); // words = One Hundred Twenty Three Point Fourty Five
let words = toWords.convert(123);
// words = One Hundred Twenty Three
words = toWords.convert(123.045); // words = One Hundred Twenty Three Point Zero Four Five
words = toWords.convert(123.45);
// words = One Hundred Twenty Three Point Fourty Five
words = toWords.convert(123.045);
// words = One Hundred Twenty Three Point Zero Four Five
```

@@ -54,6 +58,9 @@ *Note: When fractional part starts with zero, the digits after decimal points are converted into respective numbers individually*

const toWords = new ToWords();
let words = toWords.convert(452, { currency: true }); // words = Four Hundred Fifty Two Rupees Only
words = toWords.convert(452.36, { currency: true }); // words = Four Hundred Fifty Two Rupees And Thirty Six Paise Only
let words = toWords.convert(452, { currency: true });
// words = Four Hundred Fifty Two Rupees Only
words = toWords.convert(452.36, { currency: true });
// words = Four Hundred Fifty Two Rupees And Thirty Six Paise Only
```

@@ -66,3 +73,4 @@

let words = toWords.convert(452.36, { currency: true, ignoreDecimal: true }); // words = Four Hundred Fifty Two Rupees Only
let words = toWords.convert(452.36, { currency: true, ignoreDecimal: true });
// words = Four Hundred Fifty Two Rupees Only
```

@@ -75,3 +83,4 @@

let words = toWords.convert(0.572, { currency: true, ignoreZeroCurrency: true }); // words = Five Hundred Seventy Two Paise Only
let words = toWords.convert(0.572, { currency: true, ignoreZeroCurrency: true });
// words = Five Hundred Seventy Two Paise Only
```

@@ -83,4 +92,4 @@

| ------------- | ------------- | ------------- | ------------- |
| localeCode | string | 'en-IN' | Locale code for selecting i18n. Currently only `en-IN` & `en-US` are supported. Please open issue / PR if more needed. |
| currency | boolean | false | Whether the number to be converted into words written as currency. *Note: When currency:true, number will be rounded off to two decimals before converting to words* |
| localeCode | string | 'en-IN' | Locale code for selecting i18n.<br/>Currently only `en-IN` & `en-US` are supported.<br/>Please open issue / PR if more needed. |
| currency | boolean | false | Whether the number to be converted into words written as currency.<br/>*Note: When currency:true, number will be rounded off to two decimals before converting to words* |
| ignoreDecimal | boolean | false | Whether to ignore fractional unit of number while converting into words. |

@@ -87,0 +96,0 @@ | ignoreZeroCurrency | boolean | false | Whether to ignore zero currency value while converting into words. |

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