Updated layout, simplified error checking

This commit is contained in:
Taylor Courage 2024-07-03 01:54:45 -04:00
parent 89d6a62718
commit a1124e93c1
2 changed files with 8 additions and 13 deletions

View File

@ -4,11 +4,10 @@
border: 1px solid black; border: 1px solid black;
padding-left: 17px; padding-left: 17px;
padding-right: 17px; padding-right: 17px;
max-width: 400px; max-width: 350px;
min-height: 400px; min-height: 350px;
margin: auto; margin: auto;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: large;
} }
.footer { .footer {

View File

@ -8,16 +8,12 @@ function getROA() {
startSize = Math.round((startSize * 1000) / 25.4); startSize = Math.round((startSize * 1000) / 25.4);
} }
// Format our numbers to prevent maximum user stupidity // Format our numbers to prevent error
if (startSize < 1.0 && startSize > 0) { // If we have a 'proper' number i.e. ".130" if (startSize > 100) {
startSize = startSize * 1000; startSize = startSize / 1000;
} else { // re-format the number if it's 'wrong' i.e. "130" }
startSize = Number(startSize); if (finalSize > 100) {
} finalSize = finalSize / 1000;
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);
} }
// Get area from diameter // Get area from diameter