{"id":13781393,"url":"https://github.com/SalmanAA/wordifyfa","last_synced_at":"2025-05-11T14:35:03.403Z","repository":{"id":22770948,"uuid":"26116883","full_name":"SalmanAA/wordifyfa","owner":"SalmanAA","description":"Convert numbers to Persian words.","archived":false,"fork":false,"pushed_at":"2025-02-27T19:39:29.000Z","size":547,"stargazers_count":103,"open_issues_count":5,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-02T01:03:57.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SalmanAA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-03T12:08:40.000Z","updated_at":"2025-02-27T19:39:26.000Z","dependencies_parsed_at":"2023-01-13T22:11:40.262Z","dependency_job_id":"238ac8c4-b763-4f27-af19-fa8a16ff6381","html_url":"https://github.com/SalmanAA/wordifyfa","commit_stats":{"total_commits":46,"total_committers":5,"mean_commits":9.2,"dds":"0.30434782608695654","last_synced_commit":"6c5dbe053cce0b712bd76808912ad1ef4b8d552e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalmanAA%2Fwordifyfa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalmanAA%2Fwordifyfa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalmanAA%2Fwordifyfa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SalmanAA%2Fwordifyfa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SalmanAA","download_url":"https://codeload.github.com/SalmanAA/wordifyfa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253580388,"owners_count":21930934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:01:25.552Z","updated_at":"2025-05-11T14:35:03.397Z","avatar_url":"https://github.com/SalmanAA.png","language":"TypeScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"Persian Wordifier converts numbers to words.\nfor example you can use this:\n\n```javascript\nvar a = 235000;\nvar b = wordifyfa(a);\nconsole.log(b); // دویست و سی و پنج هزار\nvar c = wordifyRials(a); // دویست و سی و پنج هزار ریال\nvar d = wordifyRialsInTomans(a); // بیست و سه هزار و پانصد تومان\nvar e = 235736;\nvar f = wordifyRialsInTomans(e); //  بیست  و  سه  هزار  و  پانصد  و  هفتاد  و  سه  تومان و  شش  ریال\nvar g = wordifyMomentApprox(new Date(2022,4,4,10,20,0)); // هفت ساعت پیش \nvar h = wordifyMomentApprox(new Date(2022,4,4,10,20,0), new Date(2022,4,4,10,21,0), \"قبل\",\"بعد\"); // یک دقیقه بعد \nvar i = wordifyMomentApprox(\"2022-05-04 10:20:00\"); // هفت ساعت پیش\nvar j = momentApprox(\"2022-05-04 10:20:00\"); // 7 ساعت پیش\nvar k = wordifyMomentPrecise(\"2022-05-04 10:20:00\"); // هفت ساعت و پنج دقیقه و بیست ثانیه پیش\nvar l = momentPrecise(\"2022-05-04 10:20:00\"); // 7 ساعت و 5 دقیقه و 20 ثانیه پیش\nvar m = wordifyfa(934120, {convertDigits: false}); // 934 هزار و 120\n```\n\n*Warning!* in javascript, month starts from zero so new Date(2022,4,4,10,20,0) means month 5 (May)\n\n# update (2025-02-20)\n- options added\n- now you can enable/disable converting digits. for example 125530 =\u003e 125 هزار و 530 or یکصد و بیست و پنج هزار و پانصد و سی\n\n# update (2022-07-14)\n- precise time calculation added\n\n# update (2022-05-15)\n- approximate time calculation added\n\n# update (2020-05-15)\n- project source reimplemented in typescript\n\n# update (2020-04-18)\n- npm package created (npm i wordifyfa)\n\n# update (2020-03-11)\n- non english digits support (arabic/persian)\n```javascript\nvar a = '۱۲۰۳۴۵۱۰۲';\nvar b = wordifyfa(a);\nconsole.log(b); // یکصد و بیست میلیون و سیصد و چهل و پنج هزار و صد و یکصد و دو\n```\n\n# update (2019-09-11)\n- string and thousands separated numbers now supported\n```javascript\nvar a = '120,345,102';\nvar b = wordifyfa(a);\nconsole.log(b); // یکصد و بیست میلیون و سیصد و چهل و پنج هزار و صد و یکصد و دو\n```\n\n# installation:\n1- add this line of code in your html.\n```html\n\u003cscript src=\"wordifyfa.js\"\u003e\u003c/script\u003e\n```\t\n\nor if you are using Node.js \n\n```shell\nnpm i wordifyfa\n```\n\n```javascipt \nvar wf = require('wordifyfa.js');\n```\n\n2- use the code.\n\nin javascript:\n\n```javascript\n    var a = 93390;\n    var b = wordifyfa(a); // نود و سه هزار و سیصد و نود\n```\n\nin Node.js:\n\n```javascript\n    var a = 93390;\n    var b = wf.wordifyfa(a); // نود و سه هزار و سیصد و نود\n```\t\n\nfollowing examples are in javascript. if you want use it in Node.js, you must change it as same as previous sample.\n\n# functions:\n## 1 converts number to words\n```javascript\n\twordifyfa(number) \n\twordifyfa(43); // چهل و سه\n```\t\n\nor in Node.js :\n```javascript\n\tvar a = require('./wordifyfa.js');\n\ta.wordifyfa(number);\n```\n## 2 converts number to words with Rial sign\n```javascript\n\twordifyRials(number) \n\twordifyRials(400); // چهارصد ریال\n```\n\nor in Node : \n```javascript\n\tvar a = require('./wordifyfa.js');\n\ta.worifyfaRials(number);\n```\n\t\n## 3 converts number that is in Rials to Tomans and wordifies it\n\n```javascript\n\twordifyRialsInTomans(number) \n\twordifyRialsInTomans(5000); // پانصد تومان\n```\n\nor in Node : \n```javascript\n\tvar a = require('./wordifyfa.js');\n\ta.wordifyRialsInTomans(number);\n```\n\n## 4 supports converting persian and arabic digits \n\n```javascript\n\twordifyfa('۱۲۰۰۰۰')\n```\n## 5 convert dates to approximate time in words\n```javascript\n\twordifyMomentApprox(date,[base date=current time],[suffix if date is before base date='پیش'], [suffix if date is after base date = 'بعد']);\n\t// date and base date can be string or date object\n\t// base date and suffixes are optional\n```\n## 6 convert dates to approximate time in digits\n```javascript\n\tmomentApprox(date,[base date=current time],[suffix if date is before base date='پیش'], [suffix if date is after base date = 'بعد']);\n\t// date and base date can be string or date object\n\t// base date and suffixes are optional\n```\n## 7 convert dates to precise time difference (year/month/week/day/hour/minute/second) in words\n```javascript\n\twordifyMomentPrecise(date,[base date=current time],[suffix if date is before base date='پیش'], [suffix if date is after base date = 'بعد']);\n\t// date and base date can be string or date object\n\t// base date and suffixes are optional\n```\n## 8 convert dates to precise time difference (year/month/week/day/hour/minute/second) in digits\n```javascript\n\tmomentPrecise(date,[base date=current time],[suffix if date is before base date='پیش'], [suffix if date is after base date = 'بعد']);\n\t// date and base date can be string or date object\n\t// base date and suffixes are optional\n```\n# more info:\nthis code now supports max to 999,999,999,999,999. is it sufficient?\n\n## Main Contributors\n- [Salman Arab Ameri](http://salmanapps.ir/)  \n- [Mohammad Bagher Ehtemam](https://github.com/MBehtemam)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSalmanAA%2Fwordifyfa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSalmanAA%2Fwordifyfa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSalmanAA%2Fwordifyfa/lists"}