Skip to content

Instantly share code, notes, and snippets.

@ShabanKamell
Created March 21, 2019 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShabanKamell/485ee375e29789ea17f15514b86b33f2 to your computer and use it in GitHub Desktop.
Save ShabanKamell/485ee375e29789ea17f15514b86b33f2 to your computer and use it in GitHub Desktop.
import android.text.TextUtils;
import java.util.Locale;
public class DigitUtil {
public static String toEn(String value){
if (!TextUtils.isDigitsOnly(value))
return value;
return String.format(Locale.US, "%d", Long.valueOf(value));
}
}
@ShabanKamell
Copy link
Author

You can use this util class to convert a non-English number to English in Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment