val bigDecimal = 123456879.12.toBigDecimal()
TextField(
value = bigDecimal.toString(),
onValueChange = {},
visualTransformation = BigDecimalVisualTransformationWithUnit(
unit = "β",
)
)
//Also you can use with Text components.
Text(
text = BigDecimalVisualTransformationWithUnit().getTransformedText(
text = bigDecimal.toString(),
addedUnit = "β"
),
)
- Open the file
settings.gradle
(it looks like that)
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
// add jitpack here 👇🏽
maven { url 'https://jitpack.io' }
...
}
}
...
- Sync the project
- Add dependency
dependencies {
implementation 'com.github.commandiron:BigDecimalVisualTransformationCompose:1.0.0'
}