Added cent (area) #8

This commit is contained in:
Sad Ellie 2022-12-30 21:42:02 +04:00
parent 0fa1ebe1cb
commit aa1f5f8e9b
5 changed files with 9 additions and 2 deletions

View File

@ -564,6 +564,7 @@ class AllUnitsRepository @Inject constructor() {
} }
private val areaCollection: List<AbstractUnit> by lazy { private val areaCollection: List<AbstractUnit> by lazy {
listOf( listOf(
MyUnit(MyUnitIDS.cent, BigDecimal.valueOf(6.083246572E+33), UnitGroup.AREA, R.string.cent, R.string.cent_short),
MyUnit(MyUnitIDS.acre, BigDecimal.valueOf(6.083246572E+31), UnitGroup.AREA, R.string.acre, R.string.acre_short), MyUnit(MyUnitIDS.acre, BigDecimal.valueOf(6.083246572E+31), UnitGroup.AREA, R.string.acre, R.string.acre_short),
MyUnit(MyUnitIDS.hectare, BigDecimal.valueOf(1.503202964E+32), UnitGroup.AREA, R.string.hectare, R.string.hectare_short ), MyUnit(MyUnitIDS.hectare, BigDecimal.valueOf(1.503202964E+32), UnitGroup.AREA, R.string.hectare, R.string.hectare_short ),
MyUnit(MyUnitIDS.square_foot, BigDecimal.valueOf(1.396521251E+27), UnitGroup.AREA, R.string.square_foot, R.string.square_foot_short), MyUnit(MyUnitIDS.square_foot, BigDecimal.valueOf(1.396521251E+27), UnitGroup.AREA, R.string.square_foot, R.string.square_foot_short),

View File

@ -165,6 +165,7 @@ object MyUnitIDS {
// AREA // AREA
const val electron_cross_section = "electron_cross_section" const val electron_cross_section = "electron_cross_section"
const val cent = "cent"
const val acre = "acre" const val acre = "acre"
const val hectare = "hectare" const val hectare = "hectare"
const val square_foot = "square_foot" const val square_foot = "square_foot"

View File

@ -701,5 +701,7 @@
<string name="gigaweber">Гигавебер</string> <string name="gigaweber">Гигавебер</string>
<string name="gigaweber_short">ГВб</string> <string name="gigaweber_short">ГВб</string>
<string name="flux">Поток</string> <string name="flux">Поток</string>
<string name="cent">Цент</string>
<string name="cent_short">цент</string>
</resources> </resources>

View File

@ -324,6 +324,8 @@
<!--Area--> <!--Area-->
<string name="electron_cross_section">Electron cross section</string> <string name="electron_cross_section">Electron cross section</string>
<string name="electron_cross_section_short">ecs</string> <string name="electron_cross_section_short">ecs</string>
<string name="cent">Cent</string>
<string name="cent_short">cent</string>
<string name="acre">Acre</string> <string name="acre">Acre</string>
<string name="acre_short">ac</string> <string name="acre_short">ac</string>
<string name="hectare">Hectare</string> <string name="hectare">Hectare</string>

View File

@ -71,6 +71,7 @@ class AllUnitsTest {
@Test @Test
fun testArea() { fun testArea() {
MyUnitIDS.cent.checkWith(MyUnitIDS.acre, "75.9", "7590")
MyUnitIDS.acre.checkWith(MyUnitIDS.square_kilometer, "75.9", "0.30716") MyUnitIDS.acre.checkWith(MyUnitIDS.square_kilometer, "75.9", "0.30716")
MyUnitIDS.hectare.checkWith(MyUnitIDS.square_foot, "75.9", "8169808.00585") MyUnitIDS.hectare.checkWith(MyUnitIDS.square_foot, "75.9", "8169808.00585")
MyUnitIDS.square_foot.checkWith(MyUnitIDS.square_decimeter, "75.9", "705.13407") MyUnitIDS.square_foot.checkWith(MyUnitIDS.square_decimeter, "75.9", "705.13407")