mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 13:56:43 +02:00
format number
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
const Command = require('../../framework/Command');
|
const Command = require('../../framework/Command');
|
||||||
|
const { formatNumber } = require('../../util/Util');
|
||||||
|
|
||||||
module.exports = class WaistHipCommand extends Command {
|
module.exports = class WaistHipCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'waist-hip',
|
name: 'waist-hip',
|
||||||
aliases: ['waist-hip-ratio', 'w-h-ratio'],
|
aliases: ['waist-hip-ratio', 'w-h-ratio', 'whr'],
|
||||||
group: 'analyze',
|
group: 'analyze',
|
||||||
description: 'Responds with the waist-hip ratio of measurements.',
|
description: 'Responds with the waist-hip ratio of measurements.',
|
||||||
args: [
|
args: [
|
||||||
@@ -25,7 +26,7 @@ module.exports = class WaistHipCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { waist, hip }) {
|
run(msg, { waist, hip }) {
|
||||||
const ratio = waist / hip;
|
const ratio = formatNumber(waist / hip);
|
||||||
return msg.say(`The waist-hip ratio of someone with a ${waist} inch waist and ${hip} inch hips is **${ratio}**.`);
|
return msg.say(`The waist-hip ratio of someone with a ${waist} inch waist and ${hip} inch hips is **${ratio}**.`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user