Editing currency TextFields in Jetpack Compose
<p>Working on Android with currencies is fairly easy. There are built-in components that tell what is the default currency for our device, currency formatters, etc. Displaying currencies is easy. However, I have stumbled upon a challenge working on a new app feature.</p>
<p>I had to make a TextField that displays a price formatted with the user’s device currency. Sound easy?</p>
<p>Let’s list the requirements:</p>
<ul>
<li>The user is allowed to enter digits only. No spaces, no special characters, no manually typed currency symbols.</li>
<li>As soon as the user types some digits, the outcome needs to be formatted as currency.</li>
</ul>
<p>Take a look at the recording below to have a better understanding what is the goal. There are three different TextFields: first with default locale and USD currency, second with ENGLISH locale and USD currency, and third with ENGLISH locale and GBP currency.</p>
<p><a href="https://proandroiddev.com/editing-currency-textfields-in-jetpack-compose-b7074b4682ea"><strong>Visit Now</strong></a></p>