Skip to content

Commit

Permalink
Limit decimal digits on gauge
Browse files Browse the repository at this point in the history
  • Loading branch information
Ixam97 committed May 3, 2024
1 parent b1f5d07 commit 0ce48e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions automotive/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 29
targetSdkVersion 33
versionCode 231
versionName "0.27.0.0025"
versionCode 232
versionName "0.27.0.0026"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class CarStatsViewerScreen(
// setItemSize(GridTemplate.ITEM_SIZE_LARGE)
setSingleList(ItemList.Builder().apply {
addItem(GridItem.Builder().apply {
setTitle("${((realTimeData?.power?:0f)/1_000_000)} kW")
setTitle("${(((realTimeData?.power?:0f)/1_000_000) * 10).toInt() / 10f } kW")
setText("Power")
setImage(gauge.draw(128, (realTimeData?.power?:0f)/1_000_000, min = -150f, max = 300f).asCarIcon())
setItemSize(GridTemplate.ITEM_SIZE_LARGE)
Expand Down

0 comments on commit 0ce48e4

Please sign in to comment.