A
A
Artur Zagorsky2019-12-03 18:44:57
React Native
Artur Zagorsky, 2019-12-03 18:44:57

How to implement masking (formatting) of an input?

Need help!
It is necessary to implement masking (formatting) of the entered data.
The mask is needed like this: 90.99%, where:
9 is an optional number
0 is a mandatory
%, . -- matching characters
Example:
Input / Result
1 ---> 1%
12 ---> 12%
12.1 ---> 12.1%
12.12 ---> 12.12%
Using redux-form
Already tried react-native-text-input -mask and react-native-masked-text , however, there is no such functionality in these packages (in the first there is something similar, but '%' is correctly displayed there only if used before a number , and I need it after)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question