Closed KrisLau closed 2 years ago
@KrisLau if you want a currency input I recommend this one: https://github.com/CaioQuirinoMedeiros/react-native-currency-input
@CaioQuirinoMedeiros Does that remove leading zeroes?
also would I be able to get help on another one of my masks? I'm trying to mask a number (in ms) to seconds
@KrisLau I don't get what you want... the documentation of both libraries are pretty clear, you should only come here if you face a problem
Sorry I'll explain in more detail! So the issue I was having in the original post has been resolved by moving to the https://github.com/CaioQuirinoMedeiros/react-native-currency-input package so i'll close the issue. Thank you for that!
The second issue I'm having is I have an input where users enter the number of milliseconds and I wanted the milliseconds to be formatted to seconds and milliseconds. like this ss:mm. I thought using [/\/d/, /\/d/, ':', /\/d/, /\/d/]
would work but it was not even updating the value correctly
try [/\d/, /\d/, ':', /\d/, /\d/]
try
[/\d/, /\d/, ':', /\d/, /\d/]
@CaioQuirinoMedeiros Isn't that the same regex expression as what I had already tried (in my previous comment) unless I'm missing something? I thought that would work as well but it was not working for me. Not sure if this is important but the number could also be more than 4 digits
EDIT: I figured out how to get it to work -
createNumberMask({
delimiter: '',
seperator: '.',
precision: 3
})`
Thank you for all the help!
Exactly as the title: How do I remove the leading zeroes from a currency input using a
createNumberMask
as its mask?