All Projects → faranjit → currency_edittext

faranjit / currency_edittext

Licence: Apache-2.0 License
Simple currency formatter for Android EditText

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to currency edittext

Bankcardformat
💳 自动格式化银行卡号的EditText,卡号格式化、归属银行及卡别判断
Stars: ✭ 273 (+326.56%)
Mutual labels:  formatter, edittext
Maskara
A simple way to format text fields without getting affected by input filters
Stars: ✭ 515 (+704.69%)
Mutual labels:  formatter, edittext
AutoFormatInputWatcher
This repository contains input watcher for auto formatting digits in edit text
Stars: ✭ 15 (-76.56%)
Mutual labels:  formatter, edittext
textmatcher
A simple text watcher that matches specific targets like mention or hashtag in a string by defining rules
Stars: ✭ 67 (+4.69%)
Mutual labels:  edittext
CustomFontView
Custom View classes for TextView, EditText & Buttons - to set custom fonts
Stars: ✭ 26 (-59.37%)
Mutual labels:  edittext
kirai
String formatting library for Java, Android, Web and Unix Terminal
Stars: ✭ 69 (+7.81%)
Mutual labels:  formatter
unimport
A linter, formatter for finding and removing unused import statements.
Stars: ✭ 119 (+85.94%)
Mutual labels:  formatter
haxe-formatter
Haxe code formatter based on tokentree
Stars: ✭ 58 (-9.37%)
Mutual labels:  formatter
toml-sort
Toml sorting library
Stars: ✭ 31 (-51.56%)
Mutual labels:  formatter
CustomEditText
Simple Custom EditText for Android like Instagram
Stars: ✭ 23 (-64.06%)
Mutual labels:  edittext
pretty-remarkable
Plugin for prettifying markdown with https://github.com/jonschlinkert/remarkable using custom renderer rules.
Stars: ✭ 22 (-65.62%)
Mutual labels:  formatter
formatting
源码格式自动化调整工具
Stars: ✭ 37 (-42.19%)
Mutual labels:  formatter
Text-Length-Bar
No description or website provided.
Stars: ✭ 31 (-51.56%)
Mutual labels:  edittext
efmt
Erlang code formatter
Stars: ✭ 19 (-70.31%)
Mutual labels:  formatter
ddquery
Django Debug Query (ddquery) beautiful colored SQL statements for logging
Stars: ✭ 25 (-60.94%)
Mutual labels:  formatter
sublime-stylefmt
Sublime Text plugin for Stylefmt
Stars: ✭ 49 (-23.44%)
Mutual labels:  formatter
BlazorMonaco
Blazor component for Microsoft's Monaco Editor which powers Visual Studio Code.
Stars: ✭ 151 (+135.94%)
Mutual labels:  formatter
Code2HTML
JavaFX tool for converting source code to styled HTML
Stars: ✭ 26 (-59.37%)
Mutual labels:  formatter
mdformat
CommonMark compliant Markdown formatter
Stars: ✭ 90 (+40.63%)
Mutual labels:  formatter
clang-format-editor
Clang-Format Editor is a tool that helps you find the best Clang-Format Style for your C++, C#, Java, JavaScript, and Objective-C code.
Stars: ✭ 15 (-76.56%)
Mutual labels:  formatter

Usage

These lines formats simply your input for default locale.

<faranjit.currency.edittext.CurrencyEditText
        android:id="@+id/edt_currency"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:textColor="@android:color/black" />

You can choose any locale.

<faranjit.currency.edittext.CurrencyEditText
        android:id="@+id/edt_currency"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:textColor="@android:color/black"
        app:locale="en_US" />

or

final CurrencyEditText currencyEditText = (CurrencyEditText) findViewById(R.id.edt_currency);
currencyEditText.setLocale(new Locale("en", "US"));

CurrencyEditText shows currency symbol depending on locale or you can set it not to show.

<faranjit.currency.edittext.CurrencyEditText
        android:id="@+id/edt_currency"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:textColor="@android:color/black"
        app:locale="en_US"
        app:showSymbol="false" />

or

currencyEditText.showSymbol(false);

If you want to change grouping and monetary seperators for money symbolization you can like this.

<faranjit.currency.edittext.CurrencyEditText
        android:id="@+id/edt_currency"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="numberDecimal"
        android:textColor="@android:color/black"
        app:groupDivider="."
        app:monetaryDivider=","
        app:locale="en_US"
        app:showSymbol="true" />

or

currencyEditText.setGroupDivider('.');
currencyEditText.setMonetaryDivider(',');

When set text to 123450, this gives to output $1.234,50 instead of $1,234.50.

When you want to get double or String value of input it is enough to type these lines:

double d = currencyEditText.getCurrencyDouble();
String s = currencyEditText.getCurrencyText();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].