From a1124e93c1f8aa70a318f2c3a52f07e12c228f0a Mon Sep 17 00:00:00 2001 From: Taylor Courage Date: Wed, 3 Jul 2024 01:54:45 -0400 Subject: [PATCH] Updated layout, simplified error checking --- roacalc.css | 5 ++--- roacalc.js | 16 ++++++---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/roacalc.css b/roacalc.css index fb475d5..c56f196 100644 --- a/roacalc.css +++ b/roacalc.css @@ -4,11 +4,10 @@ border: 1px solid black; padding-left: 17px; padding-right: 17px; - max-width: 400px; - min-height: 400px; + max-width: 350px; + min-height: 350px; margin: auto; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - font-size: large; } .footer { diff --git a/roacalc.js b/roacalc.js index c43dcdb..f0ddc33 100644 --- a/roacalc.js +++ b/roacalc.js @@ -8,16 +8,12 @@ function getROA() { startSize = Math.round((startSize * 1000) / 25.4); } - // Format our numbers to prevent maximum user stupidity - if (startSize < 1.0 && startSize > 0) { // If we have a 'proper' number i.e. ".130" - startSize = startSize * 1000; - } else { // re-format the number if it's 'wrong' i.e. "130" - startSize = Number(startSize); - } - if (finalSize < 1.0 && finalSize > 0) { // If we have a 'proper' number i.e. ".130" - finalSize = finalSize * 1000; - } else { // re-format the number if it's 'wrong' i.e. "130" - finalSize = Number(finalSize); + // Format our numbers to prevent error + if (startSize > 100) { + startSize = startSize / 1000; + } + if (finalSize > 100) { + finalSize = finalSize / 1000; } // Get area from diameter