Hello! I have an idea for a plugin that might be of help to a lot of servers with inflated economies p) Plugin category: String parsing? Regex? Please read on. Minecraft version: 1.8.8 Suggested name: ScientificValue What I want: Lots of times, plugins will spit out an ugly number like 4.1e7 and nobody really knows what that means. I would love a /value command that could turn that string into formatted numbers like 41,000,000, or preferably, 41M (for million). If possible, please include letters all the way up to Q for quadrillions (i.e. /value 2.6e16 would return 26Q). Also, a config would be a nice bonus. Just a simple 'message' option to set the message to the sender, something like "&a» The value of {input} is: {formatted}" Ideas for commands: /value [#][.#]E[#] would return a formatted number as described above. Ideas for permissions: value.use. Defaults to OP, ability to use the command. When I'd like it by: As soon as you can get it done Cheers!
Much appreciated! I can't figure out how to split and use the different parts of the string "7.135e10". Let me know how it goes!
ScientificValue 1.0 BETA by Tabuu All commands and permissions can be found in the plugin.yml >> DOWNLOAD << Plugin.yml (Move your mouse to reveal the content) Plugin.yml (open) Plugin.yml (close) Code: name: ScientificValue version: 1.0 BETA main: nl.tabuu.scientificvalue.ScientificValue description: Adds a command that returns the true value of a scientificly notated number. authors: [Tabuu] website: https://www.tabuu.nl commands: value: usage: /value <Scientificly Notated Number> description: Returns the true value of a number permissions: value.use: description: Allows players to user the '/value' command. default: op
Thanks so much! I do have a few more requests if you're willing to make a 1.1 version of this plugin: Could you change the "1,1Q" to "1.1Q" to fit the US system of decimals? Could you add a message for when the given string is invalid? e.g. I executed "/value test" and the plugin threw an error: https://hastebin.com/pijebonuqa.go Could you add support for strings without a decimal, e.g. /value 2e10 Also if possible please add a try/catch when parsing the strings to avoid NPEs etc. Thanks again in advance! I find that quite a few do, unfortunately EDIT by Moderator: merged posts, please use the edit button instead of double posting.