Add decimeter as unit of length

Close #650
This commit is contained in:
MM20 2024-01-19 22:54:03 +01:00
parent 3de61e544b
commit f8f82e6294
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389
3 changed files with 11 additions and 1 deletions

View File

@ -14,6 +14,11 @@
<item quantity="one">kilometer</item>
<item quantity="other">kilometers</item>
</plurals>
<string name="unit_decimeter_symbol">dm</string>
<plurals name="unit_decimeter">
<item quantity="one">decimeter</item>
<item quantity="other">decimeters</item>
</plurals>
<string name="unit_centimeter_symbol">cm</string>
<plurals name="unit_centimeter">
<item quantity="one">centimeter</item>

View File

@ -18,6 +18,11 @@ class LengthConverter(context: Context) : SimpleFactorConverter() {
context.getString(R.string.unit_kilometer_symbol),
R.plurals.unit_kilometer
),
MeasureUnitWithFactor(
10.0,
context.getString(R.string.unit_decimeter_symbol),
R.plurals.unit_decimeter
),
MeasureUnitWithFactor(
100.0,
context.getString(R.string.unit_centimeter_symbol),

View File

@ -7,7 +7,7 @@ import de.mm20.launcher2.unitconverter.MeasureUnit
import de.mm20.launcher2.unitconverter.UnitValue
/**
* A converter for units that can converted into each other by simply multiplicating with a constant factor
* A converter for units that can converted into each other by simple multiplication with a constant factor
*/
abstract class SimpleFactorConverter: Converter {
open val standardUnits: List<MeasureUnitWithFactor> = emptyList()