Coder Social home page Coder Social logo

yamin8000 / prettypersiannumbers Goto Github PK

View Code? Open in Web Editor NEW
37.0 4.0 3.0 1.38 MB

PrettyPersianNumbers is an Android library to convert a number to a word for Persian/Farsi using Kotlin/JVM

License: GNU General Public License v3.0

Kotlin 70.12% Java 7.14% Jupyter Notebook 22.74%
android android-library kotlin kotlin-android number-to-text persian java convert-numbers persian-digit persian-number

prettypersiannumbers's Introduction

PrettyPersianNumbers

logo

Preview

ScreenShot

Check preview on imgur

Compatibility

Important

Android Jellybean 4.1+/SDK 16+

Usage

Kotlin

val word1: String = PersianDigits.spellToPersian(input)
val word2: String = PersianDigits.spellToPersian(12) // دوازده
//دوازده میلیارد و یک صد و بیست و سه میلیون و سی صد و دوازده هزار و یک صد و بیست و سه
val word3: String = PersianDigits.spellToPersian(12_123_312_123)
//پنج میلیون و یک صد و بیست و یک هزار و سی صد و بیست و یک
val word4: String = PersianDigits.spellToPersian("5121321")
//سه ممیز چهارده، صدم
val decimalWord: String = PersianDigits.spellToPersian(3.14)

Tip

In Kotlin, you can also take advantage of extension methods like:

500.spellToPersian()
"12.51".spellToPersian()

Java

String persianNumber=PersianHelpersJava.spellToFarsi("1231");

Download

Important

Find the latest version here.

Gradle Groovy DSL

Step 1. Add the Maven repository to your build file
Add it to your root build.gradle at the end of repositories:

repositories {
    mavenCentral()
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.yamin8000:PrettyPersianNumbers:$digits_last_version'
}

Maven

Add the dependency

<dependency>
    <groupId>com.github.yamin8000</groupId>
    <artifactId>PrettyPersianNumbers</artifactId>
    <version>$digits_last_version</version>
    <type>aar</type>
</dependency>  

Gradle Kotlin DSL

dependencies {
    implementation("com.github.yamin8000:PrettyPersianNumbers:$digits_last_version")
}

Features

  • Any number that could be fitted in BigInteger can be converted to Persian words using this library From Zero to Vigintillion or more
  • Convert numbers from Byte, Short, Int, Long, Float, Double, BigInteger, BigDecimal
  • Large numbers are named using short-scale standard
  • Negative numbers are supported

Credits

https://github.com/yaghoob

License

Important

Pretty Persian Numbers is licensed under the GNU General
Public License v3.0

Permissions of this strong copyleft license are conditioned on making
available complete source code of licensed works and modifications,
which include larger works using a licensed work, under the same
license. Copyright and license notices must be preserved. Contributors
provide an express grant of patent rights.

prettypersiannumbers's People

Contributors

allcontributors[bot] avatar renovate-bot avatar renovate[bot] avatar yamin8000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

prettypersiannumbers's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/android.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/cache v4
.github/workflows/dependency-submission.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/actions v3
gradle
gradle.properties
settings.gradle
build.gradle
  • com.android.tools.build:gradle 8.2.1
  • org.jetbrains.kotlin:kotlin-gradle-plugin 1.9.22
  • org.jetbrains.kotlin:kotlin-stdlib 1.9.22
Persian_Numbers/build.gradle
  • com.vanniktech.maven.publish 0.25.3
  • org.junit:junit-bom 5.10.1
app/build.gradle
  • androidx.core:core-ktx 1.12.0
  • androidx.appcompat:appcompat 1.6.1
  • com.google.android.material:material 1.11.0
  • androidx.constraintlayout:constraintlayout 2.1.4
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.2

  • Check this box to trigger a request for Renovate to run again on this repository

Write more tests

Write test for internal functions of the code instead of only writing tests for the only public function.

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.