From 4d539182f7d983b07069e1363613c91ecb9a6e4e Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 21 Sep 2018 15:03:34 +0000 Subject: [PATCH] Scientific notation command --- README.md | 3 ++- commands/number-edit/scientific-notation.js | 24 +++++++++++++++++++++ package.json | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 commands/number-edit/scientific-notation.js diff --git a/README.md b/README.md index 2fa6c4de..7182115d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Xiao is a Discord bot coded in JavaScript with The bot is no longer available for invite. You can self-host the bot, or use her on the [home server](https://discord.gg/sbMe32W). -## Commands (314) +## Commands (315) ### Utility: * **eval:** Executes JavaScript code. @@ -347,6 +347,7 @@ on the [home server](https://discord.gg/sbMe32W). * **math:** Evaluates a math expression. * **prime:** Determines if a number is a prime number. * **roman-numeral:** Converts a number to roman numerals. +* **scientific-notation:** Converts a number to scientific notation. * **scrabble-score:** Responds with the scrabble score of a word. * **units:** Converts units to/from other units. diff --git a/commands/number-edit/scientific-notation.js b/commands/number-edit/scientific-notation.js new file mode 100644 index 00000000..fa3e8f2a --- /dev/null +++ b/commands/number-edit/scientific-notation.js @@ -0,0 +1,24 @@ +const Command = require('../../structures/Command'); + +module.exports = class ScientificNotationCommand extends Command { + constructor(client) { + super(client, { + name: 'scientific-notation', + aliases: ['science-notation', 'e+', 'exponential-notation', 'exponential', 'scientific'], + group: 'number-edit', + memberName: 'scientific-notation', + description: 'Converts a number to scientific notation.', + args: [ + { + key: 'number', + prompt: 'What number do you want to convert to scientific notation?', + type: 'float' + } + ] + }); + } + + run(msg, { number }) { + return msg.reply(number.toExponential()); + } +}; diff --git a/package.json b/package.json index b865342f..b42ce396 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "91.8.13", + "version": "91.9.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {