Commit ec8781c5 by Patryk Czarnik

Prawidłowe przeliczanie walut zgodnie z testami

parent a82ff9eb
......@@ -51,11 +51,11 @@ public class Waluta {
}
public BigDecimal przeliczNaZlote(BigDecimal kwota) {
return null;
return kwota.multiply(kurs).setScale(2, RoundingMode.HALF_EVEN);
}
public BigDecimal przeliczNaWalute(BigDecimal kwotaPLN) {
return null;
return kwotaPLN.divide(kurs, 2, RoundingMode.HALF_EVEN);
}
}
......@@ -6,8 +6,6 @@ import java.math.BigDecimal;
import org.junit.jupiter.api.Test;
import waluty.wersja_xml.Waluta;
class WalutaTest {
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment