https://github.com/hidroh/numeric-edittext
A numeric EditText widget for Android
https://github.com/hidroh/numeric-edittext
android java library
Last synced: 8 months ago
JSON representation
A numeric EditText widget for Android
- Host: GitHub
- URL: https://github.com/hidroh/numeric-edittext
- Owner: hidroh
- License: apache-2.0
- Created: 2015-03-01T11:03:56.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-03-31T07:53:57.000Z (about 9 years ago)
- Last Synced: 2025-01-31T17:09:46.790Z (over 1 year ago)
- Topics: android, java, library
- Language: Java
- Size: 333 KB
- Stars: 12
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# numeric-edittext
[](https://travis-ci.org/hidroh/numeric-edittext)
A simple numeric EditText widget for Android that automatically formats input text using locale-specific decimal number format.
**Behaviour**
Input
100000.75
Will be displayed as
100,000.75
With numeric value of
100000.75

**Usage**
Layout declaration:
```xml
```
Add and remove numeric value watcher the same way `TextWatcher` works for `EditText`:
```java
numericEditText.addNumericValueChangedListener(new NumericEditText.NumericValueWatcher() {
@Override
public void onChanged(double newValue) {
// handle on numeric value changed
}
@Override
public void onCleared() {
// handle value cleared
}
});
```
Get numeric value behind input value in `EditText`:
```java
numericEditText.getNumericValue();
```
**Download**
Gradle:
```groovy
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.hidroh:numeric-edittext:0.1.0'
}
```
**License**
Copyright 2015 Ha Duy Trung
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.