Format numbers, style changes, fixes

This commit is contained in:
Daniel Odendahl Jr
2018-10-13 02:28:07 +00:00
parent 5c2c9d25a5
commit b0780575be
45 changed files with 146 additions and 159 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
const Command = require('../../structures/Command');
const math = require('mathjs');
const { formatNumber } = require('../../util/Util');
module.exports = class UnitsCommand extends Command {
constructor(client) {
@@ -34,7 +35,7 @@ module.exports = class UnitsCommand extends Command {
run(msg, { base, target, amount }) {
try {
const value = math.unit(amount, base).toNumber(target);
return msg.say(`${amount} ${base} is ${value} ${target}.`);
return msg.say(`${formatNumber(amount)} ${base} is ${formatNumber(value)} ${target}.`);
} catch (err) {
return msg.say('Either an invalid unit type was provided or the unit types do not match.');
}