mastermunj / to-words Goto Github PK
View Code? Open in Web Editor NEWConverts Numbers (including decimal points) into words. It also converts the numbers into words for currency.
License: MIT License
Converts Numbers (including decimal points) into words. It also converts the numbers into words for currency.
License: MIT License
Hello Guys ๐.
I'm wondering if can I add the arabic support to the package ?
If yes, Please confirm so I can open my PR.
Thanks!
Hi Tean,
We are using this package for currency conversion. we are facing challenge regarding locale. As per my requirements, we need to support below locales
this package is not supporting above locales. Please guide us how to implement this locale support using this package.
Currently only en-IN & en-US are supported.
We need to use and support more locale Code.
I tried using this module in Angular project. When I build my project its throwing error for types files.
WARNING in ./node_modules/to-words/dist/locales/en-US.d.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /var/lib/name/node_modules/to-words/dist/locales/en-US.d.ts is missing from the TypeScript compilation. Please make sure it is
in your tsconfig via the 'files' or 'include' property.
Tried adding the files in tsconfig but still the error is same.
Procedure to Replicate Issue
Create new angular project and install to-words library
Chnage app.component.ts like this
import { Component, OnInit } from '@angular/core';
import { ToWords } from "to-words";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
title = 'to-words-test';
ngOnInit() {
const toWords = new ToWords({
localeCode: 'en-IN', converterOptions: {
currency: true
}
});
const word = toWords.convert(1234, { currency: true });
console.log(word);
}
}
As title says, it is possible to create russian variant?
I tried below code, it works well but name
config is not working. It always considers plural
{
"localeCode": "en-IN",
"converterOptions": {
"currency": true,
"currencyOptions": {
"name": "Rupee",
"plural": "Rupees",
"symbol": "",
"fractionalUnit": {
"name": "Paisa",
"plural": "Paise",
"symbol": ""
}
}
}
}
Test#1: 1.01
outputs One Rupees And One Paise Only but should be One Rupee And One Paisa Only
Test#2: 1.00
outputs One Rupees Only but should be One Rupee Only
Can you please check this or am I missing anything ?
.2 means twenty paise and .02 means 2 paise but both returns as Two paise pls rectify it
Example:
12,345 will be twelve thousand three hundred and forty five only.
12,004 will be twelve thousand and four only.
Input
-$12.34K
Output
Minus Twelve Thousand Three Hundred Forty Dollars
hi am sagar, am updating changes and committing code, but code not committed through git
subject and type missing like error showing
When trying to convert 1.20 into "Un Euro Et Vingt Centimes" I get "Un Euros et Vingt Centimes"
There should not have a "s" in the end of "euro"
For reproducing : https://stackblitz.com/edit/node-pbkdja?file=index.js
I would like to contribute latvian language support. Pull request will follow
Hi, I'm super happy there is support for the Nigerian currency as I'm Nigerian but in my project I currently support users in Ghana and as such I'd love to have this support. I code in Javascript and have little to no knowledge of Typescript else, I'd love to contribute this
I need pemba currency. So I did download your library to add supporte for Pemba Currency.
How Can I send the file after finishing?
I will do BRL to for when possible.
Hello Guys ๐.
I'm wondering if I can add Bulgarian support to the package ?
If yes, Please confirm and approve my PR bg-locale.
Thanks!
import { LocaleInterface } from './locale.interface';
export declare class Locale implements LocaleInterface {
| currency: {
| name: string;
import { LocaleInterface } from './locale.interface';
export declare class Locale implements LocaleInterface {
| currency: {
| name: string;
your library is awesome it solved my issue and lot of custom code but am getting this console message am using it part of the CRA create react app in my project
With every new release, the size of the package is increasing.
Have a road map to manage this size.
Image Reference: https://bundlephobia.com/[email protected]
Hi @mastermunj mmk does not support crore pls replace crore with million
ex: public numberwordsMapping = [
{number:1000000, value: 'Million'},
{number: 100000,value:'Lakh'},
{number: 1000, value: 'Thousand'},
{number:100,value:'hundred'},
{number :10,value:'Ten'}
];
Regarding the conversion into words under the Indian Numbering System, in general, could you assist on this, please : https://stackoverflow.com/questions/62795243/indian-numbering-system-how-to-convert-into-the-official-and-common-use-numberi
It would be useful to have support for Spanish.
Currently we are using numero-palabra for this, but it would be good to have support as part of this package.
When currency flag is enabled and Math.floor(number) === 1. The plural currency is used instead of the singular form
1= 1 dollars
1.5 = 1 dollars and 5 cents
ERROR : - Error: Unknown Locale "en-IN"
Referenced link : facebook/react-native#6391
I have tired MMK , but this to-words package is not supporting MMK, pls add this MMK currency also for this package
ex: when we giving amount as 887.00 in digit
it should convert like : - eight hundred eighty seven Kyats only
Please provide support for UAE Dirham - en-AE locale
Getting Error while compiling: '/to-words/src/types.ts (14,17): error TS2304: Cannot find name 'unknown'
Hi @mastermunj thanks for this plugin, but can you help me on how i disable the 'ONLY' words
Thanks
I passed a value 0 to the function and it threw error.
toWords(0)
Rather I expected the library to give me a result as ZERO
It would be nice if you could add in 'converterOptions' an option to display currency name/symbol Infront of words instead of in-between. Plural can be ignored here.
eg: INR Three Million Only, USD One Hundred And Sixty Cents Only etc...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.