diff --git a/ckconv/conv.hpp b/ckconv/conv.hpp index c4021e9..d0b7906 100644 --- a/ckconv/conv.hpp +++ b/ckconv/conv.hpp @@ -318,9 +318,9 @@ namespace conv { if (str == "rd" || s.find("rod") < s.size()) return *Imperial.ROD; #endif // DISABLE_NUTJOB_UNITS - if (str == "in" || s == "i" || s.find("inch") < s.size()) + if (str == "\"" || str == "in" || s == "i" || s.find("inch") < s.size()) return *Imperial.INCH; - if (str == "ft" || s == "f" || s.find("foot") < s.size() || s.find("feet") < s.size()) + if (str == "\'" || str == "ft" || s == "f" || s.find("foot") < s.size() || s.find("feet") < s.size()) return *Imperial.FOOT; if (str == "yd" || s.find("yard") < s.size()) return *Imperial.YARD; diff --git a/ckconv/global.h b/ckconv/global.h index fe5856d..071dfe0 100644 --- a/ckconv/global.h +++ b/ckconv/global.h @@ -94,8 +94,7 @@ namespace ckconv { ss << global.csync(global.ResultColor) << outValue_s << global.csync(); if (!global.quiet) - ss - << ' ' << global.csync(global.UnitColor) << outUnit_s << global.csync(); + ss << ' ' << global.csync(global.UnitColor) << outUnit_s << global.csync(); return ss.str(); } diff --git a/ckconv/util.h b/ckconv/util.h index c33d722..ddd3bec 100644 --- a/ckconv/util.h +++ b/ckconv/util.h @@ -60,15 +60,14 @@ namespace ckconv { for (const auto& c : s) { if (str::stdpred::isdigit(c)) digit = true; - else if (str::stdpred::isalpha(c)) + else if (str::stdpred::isalpha(c) || c == '\'' || c == '\"') alpha = true; else if (c == '.') { if (++decimalPointCount > 1) throw make_exception("Input '", s, "' isn't valid! (Too many decimal places)"); } else if (c == '-') { - if (digit) - throw make_exception("Input '", s, "' isn't valid! (Negative sign must precede number)"); + if (digit) throw make_exception("Input '", s, "' isn't valid! (Negative sign must precede number)"); } else { invalid = true;