Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
com.github.faranjit:currency-edittext
Advanced tools
A custom edittext for automatically formatting currency input
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();
FAQs
A custom edittext for automatically formatting currency input
We found that com.github.faranjit:currency-edittext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.