From 96ac6101cfc9b59d3068b86e4bff3a34f60f365b Mon Sep 17 00:00:00 2001 From: "Joe L. Wroten" Date: Mon, 2 Nov 2015 11:20:57 -0600 Subject: [PATCH] Added roman numeral condition for <=0 || >= 5000 --- app.js | 1 + index.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 0d03661..c326d0b 100644 --- a/app.js +++ b/app.js @@ -58,6 +58,7 @@ var App = new Vue({ * @return {[string]} [roman numeral conversion of provided whole number] */ function intToRoman(n) { + if (n <= 0 || n >= 5000) return ''; // Set up mapping to compare crucial roman numerals to their integet values var mapping = { 'M': 1000, 'CM': 900, 'D': 500, 'CD': 400, 'C': 100, diff --git a/index.html b/index.html index f76bfbd..06d7203 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@ Roman Numerals

{{ result }}

-

{{ resultRoman }}

+

{{ resultRoman }}