Rule of the internet, better units

This commit is contained in:
Daniel Odendahl Jr
2018-03-23 21:00:32 +00:00
parent dd7ece36a2
commit c52d833b9d
5 changed files with 83 additions and 4 deletions
+2 -2
View File
@@ -33,8 +33,8 @@ module.exports = class UnitsCommand extends Command {
run(msg, { base, target, amount }) {
try {
const value = math.unit(amount, base).to(target).toString();
return msg.say(value);
const value = math.unit(amount, base).toNumber(target);
return msg.say(`${amount} ${base} is ${value} ${target}.`);
} catch (err) {
return msg.say('Either an invalid unit type was provided or the unit types do not match.');
}