Comparing version 2.0.0 to 2.0.1
@@ -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 @@ |
{ | ||
"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. | |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
42941
95
0