A set of Kotlin extension functions to convert/generate English, Persian, and Arabic digits with ease.
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.
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' }
}
}
Add the dependency:
dependencies {
implementation 'com.github.YektaDev:AnyNum:-SNAPSHOT'
}
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
.
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.