mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 00:35:26 +02:00
fix: Fix unit values
Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com>
This commit is contained in:
parent
68c17d1d97
commit
0a021975fc
@ -52,7 +52,7 @@ internal val areaCollection: List<BasicUnit> by lazy {
|
|||||||
),
|
),
|
||||||
NormalUnit(
|
NormalUnit(
|
||||||
UnitID.square_foot,
|
UnitID.square_foot,
|
||||||
BigDecimal("1396526843537100000000000000"),
|
BigDecimal("1396521251622100000000000000"),
|
||||||
UnitGroup.AREA,
|
UnitGroup.AREA,
|
||||||
R.string.unit_square_foot,
|
R.string.unit_square_foot,
|
||||||
R.string.unit_square_foot_short,
|
R.string.unit_square_foot_short,
|
||||||
@ -60,7 +60,7 @@ internal val areaCollection: List<BasicUnit> by lazy {
|
|||||||
// https://www.gowebtool.com/unit-conversion/area/convert.php?from=electron_cross_section&to=square_mile_survey_us_statute
|
// https://www.gowebtool.com/unit-conversion/area/convert.php?from=electron_cross_section&to=square_mile_survey_us_statute
|
||||||
NormalUnit(
|
NormalUnit(
|
||||||
UnitID.square_mile,
|
UnitID.square_mile,
|
||||||
BigDecimal("38932934238959000000000000000000000"),
|
BigDecimal("38932778061222000000000000000000000"),
|
||||||
UnitGroup.AREA,
|
UnitGroup.AREA,
|
||||||
R.string.unit_square_mile,
|
R.string.unit_square_mile,
|
||||||
R.string.unit_square_mile_short,
|
R.string.unit_square_mile_short,
|
||||||
|
@ -120,16 +120,18 @@ class AllUnitsTest {
|
|||||||
@Test
|
@Test
|
||||||
fun testArea() = testWithUnits {
|
fun testArea() = testWithUnits {
|
||||||
cent.checkWith(acre, "75.9", "0.759")
|
cent.checkWith(acre, "75.9", "0.759")
|
||||||
cent.checkWith(square_meter, "1", "40.469")
|
cent.checkWith(square_meter, "1", "40.46856")
|
||||||
acre.checkWith(square_kilometer, "75.9", "0.30716")
|
acre.checkWith(square_kilometer, "75.9", "0.30716")
|
||||||
acre.checkWith(square_yard, "1", "4840")
|
acre.checkWith(square_yard, "1", "4840")
|
||||||
acre.checkWith(square_meter, "1", "4046.856")
|
acre.checkWith(square_meter, "1", "4046.85642")
|
||||||
acre.checkWith(cent, "1", "4046.856")
|
acre.checkWith(cent, "1", "100")
|
||||||
hectare.checkWith(acre, "1", "2.471");
|
hectare.checkWith(acre, "1", "2.47105");
|
||||||
hectare.checkWith(acre, "1", "2.471");
|
hectare.checkWith(square_foot, "1", "107639.10417")
|
||||||
hectare.checkWith(square_foot, "75.9", "8169808.00585")
|
hectare.checkWith(square_foot, "75.9", "8169808.00628")
|
||||||
square_foot.checkWith(square_decimeter, "75.9", "705.13407")
|
square_foot.checkWith(square_decimeter, "75.9", "705.13407")
|
||||||
square_mile.checkWith(square_foot, "75.9", "2115970560.8762")
|
square_mile.checkWith(square_foot, "1", "27878400")
|
||||||
|
// Probably floating point error
|
||||||
|
square_mile.checkWith(square_foot, "75.9", "2115970560.00002")
|
||||||
square_yard.checkWith(square_foot, "75.9", "683.1")
|
square_yard.checkWith(square_foot, "75.9", "683.1")
|
||||||
square_yard.checkWith(square_foot, "1", "9")
|
square_yard.checkWith(square_foot, "1", "9")
|
||||||
square_inch.checkWith(square_foot, "75.9", "0.52708")
|
square_inch.checkWith(square_foot, "75.9", "0.52708")
|
||||||
@ -140,6 +142,7 @@ class AllUnitsTest {
|
|||||||
square_meter.checkWith(acre, "75.9", "0.01876")
|
square_meter.checkWith(acre, "75.9", "0.01876")
|
||||||
square_kilometer.checkWith(hectare, "75.9", "7590")
|
square_kilometer.checkWith(hectare, "75.9", "7590")
|
||||||
electron_cross_section.checkWith(square_micrometer, "75.9", "0.000000000000005")
|
electron_cross_section.checkWith(square_micrometer, "75.9", "0.000000000000005")
|
||||||
|
square_decimeter.checkWith(acre, "123.456", "0.00031")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user