mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
fixed color code rounding
This commit is contained in:
+5
-5
@@ -49,15 +49,15 @@ public class Resistance extends AbstractMeasure<ResistanceUnit> {
|
|||||||
switch (resistorColorCode) {
|
switch (resistorColorCode) {
|
||||||
case _4_BAND:
|
case _4_BAND:
|
||||||
bands = new Color[3];
|
bands = new Color[3];
|
||||||
bands[0] = COLOR_DIGITS[(int) Math.round(base / 10)];
|
bands[0] = COLOR_DIGITS[(int) (base / 10)];
|
||||||
bands[1] = COLOR_DIGITS[(int) Math.round(base % 10)];
|
bands[1] = COLOR_DIGITS[(int) (base % 10)];
|
||||||
bands[2] = COLOR_MULTIPLIER[multiplier + 2];
|
bands[2] = COLOR_MULTIPLIER[multiplier + 2];
|
||||||
break;
|
break;
|
||||||
case _5_BAND:
|
case _5_BAND:
|
||||||
bands = new Color[4];
|
bands = new Color[4];
|
||||||
bands[0] = COLOR_DIGITS[(int) Math.round(base / 100)];
|
bands[0] = COLOR_DIGITS[(int) (base / 100)];
|
||||||
bands[1] = COLOR_DIGITS[(int) Math.round(base / 10 % 10)];
|
bands[1] = COLOR_DIGITS[(int) (base / 10 % 10)];
|
||||||
bands[2] = COLOR_DIGITS[(int) Math.round(base % 10)];
|
bands[2] = COLOR_DIGITS[(int) (base % 10)];
|
||||||
bands[3] = COLOR_MULTIPLIER[multiplier + 2];
|
bands[3] = COLOR_MULTIPLIER[multiplier + 2];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user