@mwmiller ~ both probably good ideas :)


On Wed, Mar 5, 2014 at 8:00 PM, mwmiller <notifications@github.com> wrote:

> In lib/DDG/Goodie/Conversions.pm:
>
> >              $factor = $arg unless $factor != 1;     # drop n > 1 #s
> >
> > -            return if $factor < 0;  # negative weights seem impossible :)
> > +            if ($match_types[0] !~ /temperature|pressure/) {
> > +                return if $factor < 0;  # negative weights, etc. seem impossible :)
> > +            }
> > +
> > +            if ($match_types[0] =~ /temperature|pressure/) {
> > +                # kelvin and rankine cannot be negative:
> > +                return if ($factor < 0 && $matches[0] =~ /kelvin|rankine|k|r/i);
>
> Could you just set a "non-negative" indicator in the units descriptions?
> It would likely make maintenance and reasoning about code flow somewhat
> easier.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/duckduckgo/zeroclickinfo-goodies/pull/356/files#r10327480>
> .
>