mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 10:19:11 +02:00
Format numbers, style changes, fixes
This commit is contained in:
@@ -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.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user