Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

digitsToWords for 1000000 #56

Open
sky93 opened this issue Feb 15, 2020 · 3 comments
Open

digitsToWords for 1000000 #56

sky93 opened this issue Feb 15, 2020 · 3 comments

Comments

@sky93
Copy link

sky93 commented Feb 15, 2020

var persianjs = require("persianjs")
persianJs("1000000").digitsToWords().toString();

Expected result: یک میلیون
Returned result: یک میلیون و هزار

@mdbaniani
Copy link

var persianjs = require("persianjs")
persianJs("12000000").digitsToWords().toString();

Expected result: دوازده میلیون
Returned result: دوازده میلیون و هزار

@owlpro
Copy link

owlpro commented Oct 14, 2020

Quick fix:

persianJs(1000000).digitsToWords().toString().replace('دویصت', 'دویست').replace('و  هزار', '')

There are 2 empty spaces between و to هزار

@mdehghani65 @sky93

@emadio
Copy link

emadio commented Dec 24, 2020

Complete, accurate, and fast answer:

persianJs(12000000).digitsToWords().toString()
    .replace('دویصت', 'دویست')
    .replace('و  هزار', '')
    .replace('و  میلیون', '')
    .replace('و  میلیارد', '')
    .replace('و  تریلیون', '')
    .replace('و  کوادریلیون', '')
    .replace('و  کویینتیلیون', '') 

Attention: There are 2 empty spaces between و to هزار

Thank you, dear Mahdi (@owlpro)
@mdehghani65 @sky93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants