Giter VIP home page Giter VIP logo

mohammad-pourbafrani / persian_number_utility Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mehdi-nemati/persian_number_utility

0.0 0.0 0.0 1.43 MB

convert number to English or Persian (Farsi) letter and convert Miladi to Persian Date(Jalali/Shamsi date)

Home Page: https://pub.dev/packages/persian_number_utility

License: BSD 3-Clause "New" or "Revised" License

Objective-C 0.10% Kotlin 0.87% Dart 97.97% Swift 1.06%

persian_number_utility's Introduction

A Flutter Package for convert number to English or Persian (Farsi) letter and convert Miladi to Persian Date(Jalali/Shamsi date) and digits validator

A Flutter Package for convert number to English or Persian (Farsi) letter and allow you to separate an integer by comma (or other) for every three digits , extract number from string and convert Miladi date to Shamsi date, Afghan month, Checking the validity of the Iranian National Code and bank number and phone number, convert price to Rial or Toman

پکیجی برای تبدیل اعداد به حروف فارسی یا انگلیسی ، همچنین برای جدا سازی سه رقمی ارقام ، جداسازی ارقام از متن ، تبدیل تاریخ شمسی به میلادی، تبدیل به ماه های افغانستانی، بررسی اعتبار کد ملی ، شماره کارت بانکی و شماره موبایل ایرانیان ، تبدیل قیمت به تومان و ریال

See the Dart packages.

Screenshot

امکانات پکیج

طریقه استفاده - Usage

Add the following line to the pubspec.yaml file:

خط زیر را به فایل pubspec.yaml اضافه کنید:

dependencies:

persian_number_utility: ^1.1.3

خط زیر رو به ایمپورت های صفحه خود اضافه کنید - Add the following line to your page imports

import  'package:persian_number_utility/persian_number_utility.dart';

تبدیل عدد به حروف فارسی

Text("100092".toWord()),//صد هزار و نود و دو

تبدیل عدد به حروف انگلیسی

Text("100092".toWord(lang: NumStrLanguage.English)),//one hundred thousand ninety two

تبدیل حروف به عدد

Text('صد و یک هزار و سیصد و نود و دو'.toNumber().toString()), // 101392

جدا سازی سه رقمی ارقام

Text("100092".seRagham()),//100,092
Text("100092".seRagham(separator: "-")),//100-092

جدا سازی چهار رقمی ارقام

Text("6037991123456789".charRagham()), //6037-9911-2345-6789
Text("6037-9911-2345-6789".charRagham(separator: " ")), //6037 9911 2345 6789

جدا سازی اعداد از رشته

Text("123456+.abc".extractNumber()),//۱۲۳۴۵۶
Text("number123456اب ج -".extractNumber(toDigit: NumStrLanguage.English)),//123456

تبدیل اعداد از انگلیسی به فارسی و بالعکس

Text("123456789".toPersianDigit()),//۱۲۳۴۵۶۷۸۹
Text("۱۲۳۴۵۶۷۸۹".toEnglishDigit()),//123456789

تشخیص عددی بودن متن

Text("100092".isNumeric().toString()),//true
Text("100092aaa".isNumeric().toString()),//false

تبدیل تاریخ میلادی به شمسی

Text(DateTime.now().toPersianDate()),//۱۳۹۹/۰۷/۰۶
Text(DateTime.now().toPersianDate(twoDigits: false)),//۱۳۹۹/۷/۶
Text(DateTime.now().toPersianDate(twoDigits: true,showTime: true,timeSeprator: ' - ')),//۱۳۹۹/۰۷/۰۶ - ۰۷:۳۹

//اگه نیاز بود که زمان در سمت راست یا چپ متن قرار بگیرد
Text(DateTime.now().toPersianDate(twoDigits: true,showTime: true,changeDirectionShowTimw: false)),//۰۷:۳۹ ۱۳۹۹/۰۷/۰۶ 

تبدیل تاریخ میلادی به تاریخ شمسی از متن

Text("2020-10-07T07:47:03.233Z".toPersinaDate()),//۱۳۹۹/۷/۶

تبدیل تاریخ میلادی به تاریخ متنی شمسی

Text(DateTime.now().toPersianDateStr(strDay: true,strMonth: true)),// شانزده مهر  ۱۳۹۹
Text(DateTime.now().toPersianDateStr(showDayStr: true)),//چهارشنبه ۱۶ مهر  ۱۳۹۹
Text(DateTime.now().toPersianDateStr(strDay: true, strMonth: true, useAfghaniMonthName: true,)),//شانزده حوت ۱۳۹۹

اعتبارسنجی کد ملی ایرانیان

Text('1234567890'.isValidIranianNationalCode().toString()), // false
Text('2220042944'.isValidIranianNationalCode().toString()), // true

اعتبار سنجی شماره موبایل ایرانیان

Text('01112223344'.isValidIranianMobileNumber().toString()), // false
Text('09353391994'.isValidIranianMobileNumber().toString()), // true
Text('+989353391994'.isValidIranianMobileNumber().toString()), // true
Text('00989353391994'.isValidIranianMobileNumber().toString()), // true

نمایش خلاصه وار تاریخ نسبت به تاریخ فعلی

//Text(تاریخ و زمان مورد نظر شما .getDifferenceDateString().getDifferenceDateString())
Text(DateTime.now().add(Duration(seconds: -1)).getDifferenceDateString()),//لحظاتی پیش
Text(DateTime.now().add(Duration(seconds: -40)).getDifferenceDateString(aFewSecondsAgoText: "همین الان")),//همین الان
Text(DateTime.now().add(Duration(days: -6)).getDifferenceDateString()),//چند روز پیش
Text(DateTime.now().add(Duration(days: -1)).getDifferenceDateString()),//دیروز
Text(DateTime.now().add(Duration(days: -365)).getDifferenceDateString()),//سال پیش
Text(DateTime.now().add(Duration(days: -365)).getDifferenceDateString(lastYearText: "پارسال")),//پارسال
Text(DateTime.now().add(Duration(days: -78)).getDifferenceDateString())//چند ماه پیش

تبدیل به تومان و ریال

Text('1200'.beToman()), // 12000
Text('1200'.beRial()), // 120

اعتبار سنجی کارت بانکی

Text('1232234543212345'.isValidBankCardNumber().toString()), // false

تشخیص نام بانک از شماره کارت بانکی

Text('58921011...'.getBankNameFromCardNumber()), // بانک سپه
Text('60379911...'.getBankNameFromCardNumber()), // بانک ملی
Text('00000000...'.getBankNameFromCardNumber()), // -

تبدیل حروف غیر استاندارد به حروف استاندارد الفبای فارسی

Text('ئ ي ك ﮑ ﮐ ﮏ'.fixPersianChars()), //ی ی ک ک ک ک

حمایت از ما

⭐️ در پایان اگه خوشتون اومده بود و کارتون رو راه انداخت بهش ستاره بدین و لایکش کنین 🙏🙏

Github link

pub link - The official package repository for Dart and Flutter apps

persian_number_utility's People

Contributors

mehdi-nemati avatar ali-fadaei avatar arashmidos avatar sajadrahimi1 avatar mozaffari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.