AnyNum

General

Category
Free
Tag
Text Formatting
License
MIT License
Min SDK
1 (Android 1.0)
Registered
Apr 1, 2019
Favorites
1
Link
https://github.com/YektaDev/AnyNum
See also
FormatEditText
Phrase
RupiahEditText
blitz
ColorPhrase

Additional

Language
Kotlin
Version
1.0.0 (Apr 4, 2021)
Created
Jan 1, 2021
Updated
Apr 6, 2021 (Retired)
Owner
Ali Khaleqi Yekta (YektaDev)
Contributor
Ali Khaleqi Yekta (YektaDev)
1
Activity
Badge
Generate
Download
Source code

A set of Kotlin extension functions to convert/generate English, Persian, and Arabic digits with ease.

Dependency

Note: AnyNum is now stable and ready; however, I wasn't able to properly configure the gradle file in order to make the library accessible via JitPack. Any contribution would be highly appreciated.

Step 1

Add the JitPack repository in your root build.gradle at the end of repositories (if it doesn't exist):

allprojects {
    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2

Add the dependency:

dependencies {
    implementation 'com.github.YektaDev:AnyNum:-SNAPSHOT'
}

Common Usages

AnyNum contains below functions:

Number.toArString(): Generates Arabic digits.

Number.toFaString(): Generates Persian digits.

String.numToEn(): Convertes Arabic & Persian digits to English.

String.numToAr(): Convertes English & Persian digits to Arabic.

String.numToFa(): Convertes English & Arabic digits to Persian.

Note: a Number can be Byte, Short, Int, Long, Float, or Double.

Other Usages

String.numArToEn(): Convertes Arabic digits to English.

String.numFaToEn(): Convertes Persian digits to English.

String.numEnToAr(): Convertes English digits to Arabic.

String.numFaToAr(): Convertes Persian digits to Arabic.

String.numEnToFa(): Convertes English digits to Persian.

String.numArToFa(): Convertes Arabic digits to Persian.