Skip to content

Commit 9580c5b

Browse files
authored
Merge pull request #200 from sumitsah250/bug/199-Stone-conversion-is-inaccurate
Update UnitConv.kt
2 parents ef08b5b + ed805c7 commit 9580c5b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

app/src/main/java/yetzio/yetcalc/component/UnitConv.kt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -967,12 +967,12 @@ class UnitConv{
967967
return ounce / BigDecimal("35.274").toDouble()
968968
}
969969

970-
fun PoundsToKiloG(pound: Double): Double{
971-
return pound / BigDecimal("2.205").toDouble()
970+
fun PoundsToKiloG(pound: Double): Double {
971+
return pound * 0.45359237
972972
}
973973

974-
fun StonesToKiloG(stone: Double): Double{
975-
return stone * BigDecimal("6.35").toDouble()
974+
fun StonesToKiloG(stone: Double): Double {
975+
return stone * 6.35029318
976976
}
977977

978978
fun TonsUSToKiloG(ton: Double): Double{
@@ -1061,12 +1061,12 @@ class UnitConv{
10611061
return kilog * BigDecimal("35.274").toDouble()
10621062
}
10631063

1064-
fun KiloGToPounds(kilog: Double): Double{
1065-
return kilog * BigDecimal("2.205").toDouble()
1064+
fun KiloGToPounds(kilog: Double): Double {
1065+
return kilog / 0.45359237
10661066
}
10671067

1068-
fun KiloGToStones(kilog: Double): Double{
1069-
return kilog / BigDecimal("6.35").toDouble()
1068+
fun KiloGToStones(kilog: Double): Double {
1069+
return kilog / 6.35029318
10701070
}
10711071

10721072
fun KiloGToTonsUS(kilog: Double): Double{
@@ -2580,4 +2580,5 @@ class UnitConv{
25802580
}
25812581
}
25822582
}
2583-
}
2583+
2584+
}

0 commit comments

Comments
 (0)