Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit e2406a1

Browse files
j7eichaxkr
authored andcommitted
Fix conversions to gigabits and terabits (#75)
1 parent b4b376b commit e2406a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/duy/ncalc/unitconverter/utils/BitrateStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ public double Convert(String from, String to, double input) {
9595
}
9696
if ((from.equals(context.getResources().getString(R.string.bitrateunitbytes))) &&
9797
(to.equals(context.getResources().getString(R.string.bitrateunitgigabits)))) {
98-
double ret = input * 8 / BIT_RATE_1 / BIT_RATE_1;
98+
double ret = input * 8 / BIT_RATE_1 / BIT_RATE_1 / BIT_RATE_1;
9999
return ret;
100100
}
101101

102102
if ((from.equals(context.getResources().getString(R.string.bitrateunitbytes))) &&
103103
(to.equals(context.getResources().getString(R.string.bitrateunitterabits)))) {
104-
double ret = input * 8 / BIT_RATE_1 / BIT_RATE_1;
104+
double ret = input * 8 / BIT_RATE_1 / BIT_RATE_1 / BIT_RATE_1 / BIT_RATE_1;
105105
return ret;
106106
}
107107

0 commit comments

Comments
 (0)