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

number_to_persian_word

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

number_to_persian_word

convert numbers to persian word.

  • 1.5.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-69.23%
Maintainers
1
Weekly downloads
 
Created
Source

number_to_persian_word

A Library that Makes You Able to Convert any Number to Persian Word. This Library Supports Decimal Point, Negative Numbers and Percent.

NumberToPersianWord.js

Main Library File is ./dist/NumberToPersianWord.js. Copy it in Your Project, then Add It into Your HTML File. Enjoy :)

With npm

use npm i number_to_persian_word or yarn add number_to_persian_word then use:

const NumberToPersianWord = require("number_to_persian_word");

or you can use:

import NumberToPersianWord from "number_to_persian_word";

Functions

To Use This Library You Can Call All of it's Functions using NumberToPersianWord.functionName();

NumberToPersianWord.convert(number);

Input: a number as int or float or string

Output: Converted Number to it's Word (string)

Example:

NumberToPersianWord.convert(123); // صد و بیست و سه
NumberToPersianWord.convert(-123.2); // منفی صد و بیست و سه ممیز دو دهم
NumberToPersianWord.convert("-123.26%"); //منفی صد و بیست و سه ممیز بیست و شش صدم درصد
NumberToPersianWord.sliceNumber(number,separator=",");

Input: a number as int or float or string and a separator(Optional) (number should be in english)

Output: The number is separated by three digits of the three digits, then return it. (string)

Example:

NumberToPersianWord.sliceNumber(12345); // 12,345
NumberToPersianWord.convertEnToPe(number);

Input: a number as int or float or string (English Digits)

Output: Returns Converted English Digits into Persian Digits. (string)

Example:

NumberToPersianWord.convertEnToPe(123); // ۱۲۳
NumberToPersianWord.convertPeToEn(number);

Input: a number as string (Persian Digits)

Output: Returns Converted Persian Digits into English Digits. (string)

Example:

NumberToPersianWord.convertPeToEn("۱۲۳"); // 123

For More Examples See index.js

Keywords

FAQs

Package last updated on 26 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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